Skip to content

Commit

Permalink
Gandi compute driver should use a unique location name
Browse files Browse the repository at this point in the history
Closes #1065
  • Loading branch information
sayoun authored and tonybaloney committed Jun 18, 2017
1 parent 4a0e3f1 commit 080a5ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/examples/compute/gandi/create_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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")
2 changes: 1 addition & 1 deletion libcloud/compute/drivers/gandi.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def list_sizes(self, location=None):
def _to_loc(self, loc):
return NodeLocation(
id=loc['id'],
name=loc['name'],
name=loc['dc_code'],
country=loc['country'],
driver=self
)
Expand Down
10 changes: 9 additions & 1 deletion libcloud/test/compute/fixtures/gandi/datacenter_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
<name>id</name>
<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>
Expand All @@ -35,6 +39,10 @@
<name>iso</name>
<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>
Expand All @@ -50,4 +58,4 @@
</value>
</param>
</params>
</methodResponse>
</methodResponse>

0 comments on commit 080a5ab

Please sign in to comment.