tweaks after merge from master

This commit is contained in:
Peter Beams 2015-03-06 16:08:51 +00:00
parent e59d4fc976
commit efcba8df2e
4 changed files with 10 additions and 11 deletions

View File

@ -38,7 +38,7 @@ updatedeps:
| xargs go list -f '{{join .Deps "\n"}}' \ | xargs go list -f '{{join .Deps "\n"}}' \
| grep -v github.com/hashicorp/terraform \ | grep -v github.com/hashicorp/terraform \
| sort -u \ | sort -u \
| xargs go get -u -v | xargs go get -f -u -v
cover: cover:
@go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \ @go tool cover 2>/dev/null; if [ $$? -eq 3 ]; then \

View File

@ -65,8 +65,7 @@ func (c *Config) Client() (interface{}, error) {
creds := awsGo.Creds(c.AccessKey, c.SecretKey, c.Token) creds := awsGo.Creds(c.AccessKey, c.SecretKey, c.Token)
log.Println("[INFO] Initializing EC2 connection") log.Println("[INFO] Initializing EC2 connection")
client.ec2conn = ec2.New(auth, region) client.ec2conn = ec2.New(auth, region)
client.ec2conn2 = awsec2.New(creds, c.Region, nil)
log.Println("[INFO] Initializing ELB connection") log.Println("[INFO] Initializing ELB connection")
client.elbconn = elb.New(creds, c.Region, nil) client.elbconn = elb.New(creds, c.Region, nil)
log.Println("[INFO] Initializing AutoScaling connection") log.Println("[INFO] Initializing AutoScaling connection")

View File

@ -78,7 +78,7 @@ func resourceAwsNetworkInterface() *schema.Resource {
func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{}) error {
ec2conn := meta.(*AWSClient).ec2conn2 ec2conn := meta.(*AWSClient).awsEC2conn
request := &ec2.CreateNetworkInterfaceRequest{ request := &ec2.CreateNetworkInterfaceRequest{
Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()), Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()),
@ -101,7 +101,7 @@ func resourceAwsNetworkInterfaceCreate(d *schema.ResourceData, meta interface{})
func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) error {
ec2conn := meta.(*AWSClient).ec2conn2 ec2conn := meta.(*AWSClient).awsEC2conn
describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{ describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{
NetworkInterfaceIDs: []string{d.Id()}, NetworkInterfaceIDs: []string{d.Id()},
} }
@ -162,7 +162,7 @@ func resourceAwsNetworkInterfaceDetach(oa *schema.Set, meta interface{}, eniId s
AttachmentID: aws.String(old_attachment["attachment_id"].(string)), AttachmentID: aws.String(old_attachment["attachment_id"].(string)),
Force: aws.Boolean(true), Force: aws.Boolean(true),
} }
ec2conn := meta.(*AWSClient).ec2conn2 ec2conn := meta.(*AWSClient).awsEC2conn
detach_err := ec2conn.DetachNetworkInterface(detach_request) detach_err := ec2conn.DetachNetworkInterface(detach_request)
if detach_err != nil { if detach_err != nil {
return fmt.Errorf("Error detaching ENI: %s", detach_err) return fmt.Errorf("Error detaching ENI: %s", detach_err)
@ -189,7 +189,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{})
d.Partial(true) d.Partial(true)
if d.HasChange("attachment") { if d.HasChange("attachment") {
ec2conn := meta.(*AWSClient).ec2conn2 ec2conn := meta.(*AWSClient).awsEC2conn
oa, na := d.GetChange("attachment") oa, na := d.GetChange("attachment")
detach_err := resourceAwsNetworkInterfaceDetach(oa.(*schema.Set), meta, d.Id()) detach_err := resourceAwsNetworkInterfaceDetach(oa.(*schema.Set), meta, d.Id())
@ -220,7 +220,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{})
Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()), Groups: expandStringList(d.Get("security_groups").(*schema.Set).List()),
} }
ec2conn := meta.(*AWSClient).ec2conn2 ec2conn := meta.(*AWSClient).awsEC2conn
err := ec2conn.ModifyNetworkInterfaceAttribute(request) err := ec2conn.ModifyNetworkInterfaceAttribute(request)
if err != nil { if err != nil {
return fmt.Errorf("Failure updating ENI: %s", err) return fmt.Errorf("Failure updating ENI: %s", err)
@ -235,7 +235,7 @@ func resourceAwsNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{})
} }
func resourceAwsNetworkInterfaceDelete(d *schema.ResourceData, meta interface{}) error { func resourceAwsNetworkInterfaceDelete(d *schema.ResourceData, meta interface{}) error {
ec2conn := meta.(*AWSClient).ec2conn2 ec2conn := meta.(*AWSClient).awsEC2conn
log.Printf("[INFO] Deleting ENI: %s", d.Id()) log.Printf("[INFO] Deleting ENI: %s", d.Id())

View File

@ -71,7 +71,7 @@ func testAccCheckAWSENIExists(n string, res *ec2.NetworkInterface) resource.Test
return fmt.Errorf("No ENI ID is set") return fmt.Errorf("No ENI ID is set")
} }
ec2conn := testAccProvider.Meta().(*AWSClient).ec2conn2 ec2conn := testAccProvider.Meta().(*AWSClient).awsEC2conn
describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{ describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{
NetworkInterfaceIDs: []string{rs.Primary.ID}, NetworkInterfaceIDs: []string{rs.Primary.ID},
} }
@ -148,7 +148,7 @@ func testAccCheckAWSENIDestroy(s *terraform.State) error {
continue continue
} }
ec2conn := testAccProvider.Meta().(*AWSClient).ec2conn2 ec2conn := testAccProvider.Meta().(*AWSClient).awsEC2conn
describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{ describe_network_interfaces_request := &ec2.DescribeNetworkInterfacesRequest{
NetworkInterfaceIDs: []string{rs.Primary.ID}, NetworkInterfaceIDs: []string{rs.Primary.ID},
} }