Class a resource that is in tfstate but unable to be found on the provider as deleted
This commit is contained in:
parent
bda4ef7e7c
commit
b6abb91b83
|
@ -207,7 +207,9 @@ func resourceVcdNetworkRead(d *schema.ResourceData, meta interface{}) error {
|
|||
|
||||
network, err := vcd_client.OrgVdc.FindVDCNetwork(d.Id())
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error finding network: %#v", err)
|
||||
log.Printf("[DEBUG] Network no longer exists. Removing from tfstate")
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
|
||||
d.Set("name", network.OrgVDCNetwork.Name)
|
||||
|
|
|
@ -355,7 +355,9 @@ func resourceVcdVAppRead(d *schema.ResourceData, meta interface{}) error {
|
|||
|
||||
vapp, err := vcd_client.OrgVdc.FindVAppByName(d.Id())
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error finding vapp: %#v", err)
|
||||
log.Printf("[DEBUG] Unable to find vapp. Removing from tfstate")
|
||||
d.SetId("")
|
||||
return nil
|
||||
}
|
||||
d.Set("ip", vapp.VApp.Children.VM[0].NetworkConnectionSection.NetworkConnection.IPAddress)
|
||||
|
||||
|
|
Loading…
Reference in New Issue