From b9395b36d28b7267d3968f43495f48ca75a4757f Mon Sep 17 00:00:00 2001 From: Jon Perritt Date: Sat, 31 Jan 2015 17:22:37 -0700 Subject: [PATCH] update client methods --- .../resource_openstack_compute_instance_v2_test.go | 12 +++--------- .../resource_openstack_compute_keypair_v2_test.go | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go b/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go index ff2457d09..77559fa3a 100644 --- a/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go +++ b/builtin/providers/openstack/resource_openstack_compute_instance_v2_test.go @@ -7,8 +7,6 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" "github.com/rackspace/gophercloud/openstack/compute/v2/servers" ) @@ -33,9 +31,7 @@ func TestAccComputeV2Instance_basic(t *testing.T) { func testAccCheckComputeV2InstanceDestroy(s *terraform.State) error { config := testAccProvider.Meta().(*Config) - computeClient, err := openstack.NewComputeV2(config.osClient, gophercloud.EndpointOpts{ - Region: OS_REGION_NAME, - }) + computeClient, err := config.computeV2Client(OS_REGION_NAME) if err != nil { return fmt.Errorf("(testAccCheckComputeV2InstanceDestroy) Error creating OpenStack compute client: %s", err) } @@ -65,10 +61,8 @@ func testAccCheckComputeV2InstanceExists(t *testing.T, n string, instance *serve return fmt.Errorf("No ID is set") } - osClient := testAccProvider.Meta().(*Config).osClient - computeClient, err := openstack.NewComputeV2(osClient, gophercloud.EndpointOpts{ - Region: OS_REGION_NAME, - }) + config := testAccProvider.Meta().(*Config) + computeClient, err := config.computeV2Client(OS_REGION_NAME) if err != nil { return fmt.Errorf("(testAccCheckComputeV2InstanceExists) Error creating OpenStack compute client: %s", err) } diff --git a/builtin/providers/openstack/resource_openstack_compute_keypair_v2_test.go b/builtin/providers/openstack/resource_openstack_compute_keypair_v2_test.go index 0456341df..da090bcd8 100644 --- a/builtin/providers/openstack/resource_openstack_compute_keypair_v2_test.go +++ b/builtin/providers/openstack/resource_openstack_compute_keypair_v2_test.go @@ -7,8 +7,6 @@ import ( "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" - "github.com/rackspace/gophercloud" - "github.com/rackspace/gophercloud/openstack" "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs" ) @@ -32,9 +30,7 @@ func TestAccComputeV2Keypair_basic(t *testing.T) { func testAccCheckComputeV2KeypairDestroy(s *terraform.State) error { config := testAccProvider.Meta().(*Config) - computeClient, err := openstack.NewComputeV2(config.osClient, gophercloud.EndpointOpts{ - Region: OS_REGION_NAME, - }) + computeClient, err := config.computeV2Client(OS_REGION_NAME) if err != nil { return fmt.Errorf("(testAccCheckComputeV2KeypairDestroy) Error creating OpenStack compute client: %s", err) } @@ -64,10 +60,8 @@ func testAccCheckComputeV2KeypairExists(t *testing.T, n string, kp *keypairs.Key return fmt.Errorf("No ID is set") } - osClient := testAccProvider.Meta().(*Config).osClient - computeClient, err := openstack.NewComputeV2(osClient, gophercloud.EndpointOpts{ - Region: OS_REGION_NAME, - }) + config := testAccProvider.Meta().(*Config) + computeClient, err := config.computeV2Client(OS_REGION_NAME) if err != nil { return fmt.Errorf("(testAccCheckComputeV2KeypairExists) Error creating OpenStack compute client: %s", err) }