Merge remote-tracking branch 'upstream/master' into b-aws-sg-rule-self

* upstream/master:
  Correct syntax error in group membership test.
  Add beta compute client
This commit is contained in:
Clint Shryock 2015-06-10 09:41:26 -05:00
commit 1b80674c92
2 changed files with 10 additions and 1 deletions

View File

@ -59,7 +59,7 @@ func testAccCheckAWSGroupMembershipDestroy(s *terraform.State) error {
for _, u := range resp.Users { for _, u := range resp.Users {
for _, i := range users { for _, i := range users {
if i == *u.UserName { if i == *u.UserName {
return fmt.Errorf("Error: User (s) still a member of Group (%s)", i, *resp.Group.GroupName) return fmt.Errorf("Error: User (%s) still a member of Group (%s)", i, *resp.Group.GroupName)
} }
} }
} }

View File

@ -14,6 +14,7 @@ import (
"golang.org/x/oauth2/google" "golang.org/x/oauth2/google"
"golang.org/x/oauth2/jwt" "golang.org/x/oauth2/jwt"
"google.golang.org/api/compute/v1" "google.golang.org/api/compute/v1"
computeBeta "google.golang.org/api/compute/v0.beta"
"google.golang.org/api/dns/v1" "google.golang.org/api/dns/v1"
"google.golang.org/api/storage/v1" "google.golang.org/api/storage/v1"
) )
@ -26,6 +27,7 @@ type Config struct {
Region string Region string
clientCompute *compute.Service clientCompute *compute.Service
clientComputeBeta *computeBeta.Service
clientDns *dns.Service clientDns *dns.Service
clientStorage *storage.Service clientStorage *storage.Service
} }
@ -110,6 +112,13 @@ func (c *Config) loadAndValidate() error {
} }
c.clientCompute.UserAgent = userAgent c.clientCompute.UserAgent = userAgent
log.Printf("[INFO] Instantiating Beta GCE client...")
c.clientComputeBeta, err = computeBeta.New(client)
if err != nil {
return err
}
c.clientComputeBeta.UserAgent = userAgent
log.Printf("[INFO] Instantiating Google Cloud DNS client...") log.Printf("[INFO] Instantiating Google Cloud DNS client...")
c.clientDns, err = dns.New(client) c.clientDns, err = dns.New(client)
if err != nil { if err != nil {