Add logging when instance no longer exists

This commit is contained in:
Matt Morrison 2015-11-06 10:15:35 +13:00
parent 5f90a4bc7e
commit ede5ebb368
1 changed files with 2 additions and 0 deletions

View File

@ -549,9 +549,11 @@ func resourceComputeInstanceCreate(d *schema.ResourceData, meta interface{}) err
func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error {
config := meta.(*Config)
id := d.Id()
instance, err := getInstance(config, d)
if err != nil {
if strings.Contains(err.Error(), "no longer exists") {
log.Printf("[WARN] Google Compute Instance (%s) not found", id)
return nil
}
return err