Merge pull request #1407 from terraform-providers/paddy_sql_err

Check error in SQL user test.
This commit is contained in:
Paddy 2018-04-30 16:23:54 -07:00 committed by GitHub
commit c5580ca12d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -91,6 +91,10 @@ func testAccCheckGoogleSqlUserExists(n string) resource.TestCheckFunc {
users, err := config.clientSqlAdmin.Users.List(config.Project,
instance).Do()
if err != nil {
return err
}
for _, user := range users.Items {
if user.Name == name && user.Host == host {
return nil