diff --git a/libcloud/common/ovh.py b/libcloud/common/ovh.py index d2233c1e40..edf905dc9a 100644 --- a/libcloud/common/ovh.py +++ b/libcloud/common/ovh.py @@ -63,6 +63,23 @@ "SYD1": {"id": "SYD1", "name": "Sydney 1", "country": "AU"}, "VIN1": {"id": "VIN1", "name": "Vint Hill, Virginia 1", "country": "US"}, "WAW1": {"id": "WAW1", "name": "Warsaw 1", "country": "PL"}, + "BHS": {"id": "BHS", "name": "Beauharnois, Quebec", "country": "CA"}, + "CA-EAST-TOR": {"id": "CA-EAST-TOR", "name": "Toronto, Canada", "country": "CA"}, + "DE": {"id": "DE", "name": "Germany", "country": "DE"}, + "DE1": {"id": "DE1", "name": "Germany 1", "country": "DE"}, + "EU-SOUTH-MIL": {"id": "EU-SOUTH-MIL", "name": "Milan, Italy", "country": "IT"}, + "EU-WEST-PAR": {"id": "EU-WEST-PAR", "name": "Paris, France", "country": "FR"}, + "GRA": {"id": "GRA", "name": "Gravelines", "country": "FR"}, + "GRA9": {"id": "GRA9", "name": "Gravelines 9", "country": "FR"}, + "GRA11": {"id": "GRA11", "name": "Gravelines 11", "country": "FR"}, + "RBX": {"id": "RBX", "name": "Roubaix", "country": "FR"}, + "RBX-A": {"id": "RBX-A", "name": "Roubaix A", "country": "FR"}, + "RBX-ARCHIVE": {"id": "RBX-ARCHIVE", "name": "Roubaix Archive", "country": "FR"}, + "SBG": {"id": "SBG", "name": "Strasbourg", "country": "FR"}, + "SBG5": {"id": "SBG5", "name": "Strasbourg 5", "country": "FR"}, + "UK": {"id": "UK", "name": "United Kingdom", "country": "UK"}, + "UK1": {"id": "UK1", "name": "United Kingdom 1", "country": "UK"}, + "WAW": {"id": "WAW", "name": "Warsaw", "country": "PL"}, } DEFAULT_ACCESS_RULES = [ {"method": "GET", "path": "/*"}, diff --git a/libcloud/compute/drivers/ovh.py b/libcloud/compute/drivers/ovh.py index e62fceaa40..a32eac519d 100644 --- a/libcloud/compute/drivers/ovh.py +++ b/libcloud/compute/drivers/ovh.py @@ -29,7 +29,6 @@ from libcloud.compute.types import Provider, StorageVolumeState, VolumeSnapshotState from libcloud.compute.drivers.openstack import OpenStackKeyPair, OpenStackNodeDriver - class OvhNodeDriver(NodeDriver): """ Libcloud driver for the Ovh API @@ -537,7 +536,9 @@ def _to_volumes(self, objs): return [self._to_volume(obj) for obj in objs] def _to_location(self, obj): - location = self.connectionCls.LOCATIONS[obj] + location = self.connectionCls.LOCATIONS.get(obj) + if not location: + location = {"id": obj, "name": obj, "country": ""} return NodeLocation(driver=self, **location)