Repository: libcloud Updated Branches: refs/heads/trunk 4a0e3f143 -> 238db6d96
Gandi compute driver should use a unique location name Closes #1065 Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/080a5abd Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/080a5abd Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/080a5abd Branch: refs/heads/trunk Commit: 080a5abdebb49022ac5a40f409baeb58f50d1c30 Parents: 4a0e3f1 Author: sayoun <[email protected]> Authored: Tue May 30 12:17:23 2017 +0200 Committer: Anthony Shaw <[email protected]> Committed: Sun Jun 18 12:35:15 2017 +1000 ---------------------------------------------------------------------- docs/examples/compute/gandi/create_node.py | 2 +- libcloud/compute/drivers/gandi.py | 2 +- libcloud/test/compute/fixtures/gandi/datacenter_list.xml | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/080a5abd/docs/examples/compute/gandi/create_node.py ---------------------------------------------------------------------- diff --git a/docs/examples/compute/gandi/create_node.py b/docs/examples/compute/gandi/create_node.py index 213f9eb..8f33fac 100644 --- a/docs/examples/compute/gandi/create_node.py +++ b/docs/examples/compute/gandi/create_node.py @@ -6,7 +6,7 @@ driver = Gandi('api_key') image = [i for i in driver.list_images() if 'Debian 8 64' in i.name][0] size = [s for s in driver.list_sizes() if s.name == 'Medium instance'][0] -location = [l for l in driver.list_locations() if l.name == 'Equinix Paris'][0] +location = [l for l in driver.list_locations() if l.name == 'FR-SD2'][0] node = driver.create_node(name='yournode', size=size, image=image, location=location, login="youruser", password="pass") http://git-wip-us.apache.org/repos/asf/libcloud/blob/080a5abd/libcloud/compute/drivers/gandi.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/gandi.py b/libcloud/compute/drivers/gandi.py index 844850a..af039cf 100644 --- a/libcloud/compute/drivers/gandi.py +++ b/libcloud/compute/drivers/gandi.py @@ -436,7 +436,7 @@ class GandiNodeDriver(BaseGandiDriver, NodeDriver): def _to_loc(self, loc): return NodeLocation( id=loc['id'], - name=loc['name'], + name=loc['dc_code'], country=loc['country'], driver=self ) http://git-wip-us.apache.org/repos/asf/libcloud/blob/080a5abd/libcloud/test/compute/fixtures/gandi/datacenter_list.xml ---------------------------------------------------------------------- diff --git a/libcloud/test/compute/fixtures/gandi/datacenter_list.xml b/libcloud/test/compute/fixtures/gandi/datacenter_list.xml index 9d8cc68..09135a4 100644 --- a/libcloud/test/compute/fixtures/gandi/datacenter_list.xml +++ b/libcloud/test/compute/fixtures/gandi/datacenter_list.xml @@ -20,6 +20,10 @@ <value><int>1</int></value> </member> <member> + <name>dc_code</name> + <value><string>FR-SD2</string></value> + </member> + <member> <name>name</name> <value><string>Equinix Paris</string></value> </member> @@ -36,6 +40,10 @@ <value><string>US</string></value> </member> <member> + <name>dc_code</name> + <value><string>US-BA1</string></value> + </member> + <member> <name>id</name> <value><int>2</int></value> </member> @@ -50,4 +58,4 @@ </value> </param> </params> -</methodResponse> \ No newline at end of file +</methodResponse>
