+ resp.Diagnostics.AddError("OpenStack Auth URL not set", "The provider is unable to determine the OpenStack Auth URL. Please configure this setting in the provider block or by using the OS_AUTH_URL environment variable.")
+ }
+ }
+
+ if data.OsProjectId.IsNull() {
+ envVar := os.Getenv("OS_PROJECT_ID")
+
+ if envVar != "" {
+ data.OsProjectId = types.StringValue(envVar)
+ } else {
+ resp.Diagnostics.AddError("OpenStack Project ID not set", "The provider is unable to determine the OpenStack Project ID. Please configure this setting in the provider block or by using the OS_PROJECT_ID environment variable.")
+ resp.Diagnostics.AddError("OpenStack Application Credential ID not set", "The provider is unable to determine the OpenStack Application Credential ID. Please configure this setting in the provider block or by using the OS_APPLICATION_CREDENTIAL_ID environment variable.")
+ }
+ }
+
+ if data.OsApplicationCredentialSecret.IsNull() {
+ resp.Diagnostics.AddError("OpenStack Application Credential Secret not set", "The provider is unable to determine the OpenStack Application Credential Secret. Please configure this setting in the provider block or by using the OS_APPLICATION_CREDENTIAL_SECRET environment variable.")