provider/google: remove deprecated account_file field.

Remove the shims for the long-deprecated account_file field in the
Google provider.
This commit is contained in:
Paddy 2017-03-13 21:58:39 -07:00
parent d5d0f4f0a8
commit b908568d40

View File

@ -21,7 +21,7 @@ func Provider() terraform.ResourceProvider {
Optional: true, Optional: true,
DefaultFunc: schema.EnvDefaultFunc("GOOGLE_ACCOUNT_FILE", nil), DefaultFunc: schema.EnvDefaultFunc("GOOGLE_ACCOUNT_FILE", nil),
ValidateFunc: validateAccountFile, ValidateFunc: validateAccountFile,
Deprecated: "Use the credentials field instead", Removed: "Use the credentials field instead",
}, },
"credentials": &schema.Schema{ "credentials": &schema.Schema{
@ -115,9 +115,6 @@ func Provider() terraform.ResourceProvider {
func providerConfigure(d *schema.ResourceData) (interface{}, error) { func providerConfigure(d *schema.ResourceData) (interface{}, error) {
credentials := d.Get("credentials").(string) credentials := d.Get("credentials").(string)
if credentials == "" {
credentials = d.Get("account_file").(string)
}
config := Config{ config := Config{
Credentials: credentials, Credentials: credentials,
Project: d.Get("project").(string), Project: d.Get("project").(string),
@ -147,9 +144,7 @@ func validateAccountFile(v interface{}, k string) (warnings []string, errors []e
errors = append(errors, fmt.Errorf("Error loading Account File: %s", err)) errors = append(errors, fmt.Errorf("Error loading Account File: %s", err))
} }
if wasPath { if wasPath {
warnings = append(warnings, `account_file was provided as a path instead of errors = append(errors, fmt.Errorf(`Error loading credentials; they were provided as a path instead of file contents. Please use ${file("%s")} instead.`, value))
as file contents. This support will be removed in the future. Please update
your configuration to use ${file("filename.json")} instead.`)
} }
var account accountFile var account accountFile