helper/schema: Avoid erroring out on undefined timeouts

pull/19312/head
Radek Simko 8 years ago
parent c795302ab2
commit 0cbf745e5a
No known key found for this signature in database
GPG Key ID: 1F1C84FE689A88D7

@ -5,6 +5,7 @@ import (
"log"
"time"
"github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/terraform"
"github.com/mitchellh/copystructure"
)
@ -105,10 +106,16 @@ func (t *ResourceTimeout) ConfigDecode(s *Resource, c *terraform.ResourceConfig)
*timeout = rt
}
} else {
log.Printf("[ERROR] Invalid timeout structure: %T", raw)
return fmt.Errorf("Invalid Timeout structure found")
return nil
}
if v, ok := raw.(string); ok && v == config.UnknownVariableValue {
// Timeout is not defined in the config
// Defaults will be used instead
return nil
}
log.Printf("[ERROR] Invalid timeout structure: %T", raw)
return fmt.Errorf("Invalid Timeout structure found")
}
return nil

Loading…
Cancel
Save