provider/azurerm: Use separate "if" over "else if"

This commit is contained in:
James Nugent 2016-02-03 13:16:36 -05:00
parent e968343871
commit 295bb897f2
2 changed files with 10 additions and 5 deletions

View File

@ -57,7 +57,8 @@ func resourceArmDnsZoneCreate(d *schema.ResourceData, meta interface{}) error {
createResponse, err := createRequest.Execute()
if err != nil {
return fmt.Errorf("Error creating DNS Zone: %s", err)
} else if !createResponse.IsSuccessful() {
}
if !createResponse.IsSuccessful() {
return fmt.Errorf("Error creating DNS Zone: %s", createResponse.Error)
}
@ -70,7 +71,8 @@ func resourceArmDnsZoneCreate(d *schema.ResourceData, meta interface{}) error {
readResponse, err := readRequest.Execute()
if err != nil {
return fmt.Errorf("Error reading DNS Zone: %s", err)
} else if !readResponse.IsSuccessful() {
}
if !readResponse.IsSuccessful() {
return fmt.Errorf("Error reading DNS Zone: %s", readResponse.Error)
}
@ -90,7 +92,8 @@ func resourceArmDnsZoneRead(d *schema.ResourceData, meta interface{}) error {
readResponse, err := readRequest.Execute()
if err != nil {
return fmt.Errorf("Error reading DNS Zone: %s", err)
} else if !readResponse.IsSuccessful() {
}
if !readResponse.IsSuccessful() {
log.Printf("[INFO] Error reading DNS Zone %q - removing from state", d.Id())
d.SetId("")
return fmt.Errorf("Error reading DNS Zone: %s", readResponse.Error)
@ -114,7 +117,8 @@ func resourceArmDnsZoneDelete(d *schema.ResourceData, meta interface{}) error {
deleteResponse, err := deleteRequest.Execute()
if err != nil {
return fmt.Errorf("Error deleting DNS Zone: %s", err)
} else if !deleteResponse.IsSuccessful() {
}
if !deleteResponse.IsSuccessful() {
return fmt.Errorf("Error deleting DNS Zone: %s", deleteResponse.Error)
}

View File

@ -45,7 +45,8 @@ func testCheckAzureRMDnsZoneExists(name string) resource.TestCheckFunc {
readResponse, err := readRequest.Execute()
if err != nil {
return fmt.Errorf("Bad: GetDNSZone: %s", err)
} else if !readResponse.IsSuccessful() {
}
if !readResponse.IsSuccessful() {
return fmt.Errorf("Bad: GetDNSZone: %s", readResponse.Error)
}