provider/triton: Recognize 404 for Firewall Rules

This commit is contained in:
James Nugent 2016-05-06 16:51:20 -07:00
parent 49085d58b9
commit f364265900
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package triton
import (
"github.com/hashicorp/terraform/helper/schema"
"github.com/joyent/gocommon/errors"
"github.com/joyent/gosdc/cloudapi"
)
@ -54,6 +55,9 @@ func resourceFirewallRuleExists(d *schema.ResourceData, meta interface{}) (bool,
client := meta.(*cloudapi.Client)
rule, err := client.GetFirewallRule(d.Id())
if errors.IsResourceNotFound(err) {
return false, nil
}
return rule != nil && err == nil, err
}