Browse Source

Update to gophercloud/gophercloud

Per https://github.com/rackspace/gophercloud, the git repo is frozen
and work has moved to https://github.com/gophercloud/gophercloud.

So let's switch over to the new repository

Change-Id: I754b0a6e3b9a25745158fa1453aee48ca325d0f7
Davanum Srinivas 2 years ago
parent
commit
38fe101d63
3 changed files with 60 additions and 36 deletions
  1. 25
    17
      driver/client.go
  2. 9
    18
      glide.lock
  3. 26
    1
      glide.yaml

+ 25
- 17
driver/client.go View File

@@ -11,19 +11,19 @@ import (
11 11
 	"github.com/docker/machine/libmachine/log"
12 12
 	"github.com/docker/machine/libmachine/mcnutils"
13 13
 	"github.com/docker/machine/libmachine/version"
14
-	"github.com/rackspace/gophercloud"
15
-	"github.com/rackspace/gophercloud/openstack"
16
-	compute_ips "github.com/rackspace/gophercloud/openstack/compute/v2/extensions/floatingip"
17
-	"github.com/rackspace/gophercloud/openstack/compute/v2/extensions/keypairs"
18
-	"github.com/rackspace/gophercloud/openstack/compute/v2/extensions/startstop"
19
-	"github.com/rackspace/gophercloud/openstack/compute/v2/flavors"
20
-	"github.com/rackspace/gophercloud/openstack/compute/v2/images"
21
-	"github.com/rackspace/gophercloud/openstack/compute/v2/servers"
22
-	"github.com/rackspace/gophercloud/openstack/identity/v2/tenants"
23
-	"github.com/rackspace/gophercloud/openstack/networking/v2/extensions/layer3/floatingips"
24
-	"github.com/rackspace/gophercloud/openstack/networking/v2/networks"
25
-	"github.com/rackspace/gophercloud/openstack/networking/v2/ports"
26
-	"github.com/rackspace/gophercloud/pagination"
14
+	"github.com/gophercloud/gophercloud"
15
+	"github.com/gophercloud/gophercloud/openstack"
16
+	compute_ips "github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/floatingips"
17
+	"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/keypairs"
18
+	"github.com/gophercloud/gophercloud/openstack/compute/v2/extensions/startstop"
19
+	"github.com/gophercloud/gophercloud/openstack/compute/v2/flavors"
20
+	"github.com/gophercloud/gophercloud/openstack/compute/v2/images"
21
+	"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
22
+	"github.com/gophercloud/gophercloud/openstack/identity/v2/tenants"
23
+	"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/layer3/floatingips"
24
+	"github.com/gophercloud/gophercloud/openstack/networking/v2/networks"
25
+	"github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
26
+	"github.com/gophercloud/gophercloud/pagination"
27 27
 )
28 28
 
29 29
 type Client interface {
@@ -134,7 +134,8 @@ func (c *GenericClient) StopInstance(d *Driver) error {
134 134
 }
135 135
 
136 136
 func (c *GenericClient) RestartInstance(d *Driver) error {
137
-	if result := servers.Reboot(c.Compute, d.MachineId, servers.SoftReboot); result.Err != nil {
137
+	opts := &servers.RebootOpts{Type: servers.SoftReboot}
138
+	if result := servers.Reboot(c.Compute, d.MachineId, opts); result.Err != nil {
138 139
 		return result.Err
139 140
 	}
140 141
 	return nil
@@ -356,7 +357,8 @@ func (c *GenericClient) assignNovaFloatingIP(d *Driver, floatingIP *FloatingIP)
356 357
 		floatingIP.Ip = f.IP
357 358
 		floatingIP.Pool = f.Pool
358 359
 	}
359
-	return compute_ips.Associate(c.Compute, d.MachineId, floatingIP.Ip).Err
360
+	opts := &compute_ips.AssociateOpts{FloatingIP: floatingIP.Ip}
361
+	return compute_ips.AssociateInstance(c.Compute, d.MachineId, opts).Err
360 362
 }
361 363
 
362 364
 func (c *GenericClient) assignNeutronFloatingIP(d *Driver, floatingIP *FloatingIP) error {
@@ -379,7 +381,7 @@ func (c *GenericClient) assignNeutronFloatingIP(d *Driver, floatingIP *FloatingI
379 381
 		return nil
380 382
 	}
381 383
 	_, err = floatingips.Update(c.Network, floatingIP.Id, floatingips.UpdateOpts{
382
-		PortID: portID,
384
+		PortID: &portID,
383 385
 	}).Extract()
384 386
 	if err != nil {
385 387
 		return err
@@ -495,7 +497,13 @@ func (c *GenericClient) InitIdentityClient(d *Driver) error {
495 497
 		return nil
496 498
 	}
497 499
 
498
-	identity := openstack.NewIdentityV2(c.Provider)
500
+	identity, err := openstack.NewIdentityV2(c.Provider, gophercloud.EndpointOpts{
501
+		Region:       d.Region,
502
+		Availability: c.getEndpointType(d),
503
+	})
504
+	if err != nil {
505
+		return err
506
+	}
499 507
 	c.Identity = identity
500 508
 	return nil
501 509
 }

+ 9
- 18
glide.lock View File

@@ -1,5 +1,5 @@
1
-hash: 2ae414367804198c51ad47534bc4a00c8b68b2eddb850ffcfdf5f3a112b68b65
2
-updated: 2017-03-16T16:09:29.619642963-04:00
1
+hash: f0fdc617a0337ac35ef7e13ce83e231286bb4636974151ac8a57680af8d064f7
2
+updated: 2017-03-23T15:12:37.058586603-04:00
3 3
 imports:
4 4
 - name: github.com/docker/docker
5 5
   version: a8a31eff10544860d2188dddabdee4d727545796
@@ -9,9 +9,6 @@ imports:
9 9
   version: 0f08d3c510bc8c2a2c087cabd6614d8776ca8687
10 10
   subpackages:
11 11
   - libmachine/drivers
12
-  - libmachine/drivers/plugin
13
-  - libmachine/drivers/plugin/localbinary
14
-  - libmachine/drivers/rpc
15 12
   - libmachine/log
16 13
   - libmachine/mcnflag
17 14
   - libmachine/mcnutils
@@ -19,13 +16,11 @@ imports:
19 16
   - libmachine/state
20 17
   - libmachine/version
21 18
   - version
22
-- name: github.com/mitchellh/mapstructure
23
-  version: 740c764bc6149d3f1806231418adb9f52c11bcbf
24
-- name: github.com/rackspace/gophercloud
25
-  version: ce0f487f6747ab43c4e4404722df25349385bebd
19
+- name: github.com/gophercloud/gophercloud
20
+  version: 9a5595b8ffe429439c63781cdc312c254e4ad990
26 21
   subpackages:
27 22
   - openstack
28
-  - openstack/compute/v2/extensions/floatingip
23
+  - openstack/compute/v2/extensions/floatingips
29 24
   - openstack/compute/v2/extensions/keypairs
30 25
   - openstack/compute/v2/extensions/startstop
31 26
   - openstack/compute/v2/flavors
@@ -39,14 +34,6 @@ imports:
39 34
   - openstack/networking/v2/ports
40 35
   - openstack/utils
41 36
   - pagination
42
-  - rackspace
43
-  - rackspace/identity/v2/tokens
44
-  - testhelper
45
-  - testhelper/client
46
-- name: github.com/stretchr/testify
47
-  version: 4d4bfba8f1d1027c4fdbe371823030df51419987
48
-  subpackages:
49
-  - assert
50 37
 - name: golang.org/x/crypto
51 38
   version: beef0f4390813b96e8e68fd78570396d0f4751fc
52 39
   subpackages:
@@ -62,3 +49,7 @@ testImports:
62 49
   version: 792786c7400a136282c1664665ae0a8db921c6c2
63 50
   subpackages:
64 51
   - difflib
52
+- name: github.com/stretchr/testify
53
+  version: 4d4bfba8f1d1027c4fdbe371823030df51419987
54
+  subpackages:
55
+  - assert

+ 26
- 1
glide.yaml View File

@@ -1,4 +1,29 @@
1 1
 package: git.openstack.org/openstack/docker-machine-openstack
2 2
 import:
3 3
 - package: github.com/docker/machine
4
-- package: github.com/stretchr/testify
4
+  subpackages:
5
+  - libmachine/drivers
6
+  - libmachine/log
7
+  - libmachine/mcnflag
8
+  - libmachine/mcnutils
9
+  - libmachine/ssh
10
+  - libmachine/state
11
+  - libmachine/version
12
+- package: github.com/gophercloud/gophercloud
13
+  subpackages:
14
+  - openstack
15
+  - openstack/compute/v2/extensions/floatingips
16
+  - openstack/compute/v2/extensions/keypairs
17
+  - openstack/compute/v2/extensions/startstop
18
+  - openstack/compute/v2/flavors
19
+  - openstack/compute/v2/images
20
+  - openstack/compute/v2/servers
21
+  - openstack/identity/v2/tenants
22
+  - openstack/networking/v2/extensions/layer3/floatingips
23
+  - openstack/networking/v2/networks
24
+  - openstack/networking/v2/ports
25
+  - pagination
26
+testImport:
27
+- package: github.com/stretchr/testify
28
+  subpackages:
29
+  - assert

Loading…
Cancel
Save