From f93a7caf3d4bca655a09dcd779fb79296b60d7b2 Mon Sep 17 00:00:00 2001 From: Ali Modaresi Date: Tue, 17 Feb 2026 11:08:02 +0100 Subject: [PATCH 1/3] add more location to OVH and avoid exception when location is not in the list --- libcloud/common/ovh.py | 18 ++++++++++++++++++ libcloud/compute/drivers/ovh.py | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/libcloud/common/ovh.py b/libcloud/common/ovh.py index d2233c1e40..242aad219c 100644 --- a/libcloud/common/ovh.py +++ b/libcloud/common/ovh.py @@ -63,6 +63,24 @@ "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..cf07a8914c 100644 --- a/libcloud/compute/drivers/ovh.py +++ b/libcloud/compute/drivers/ovh.py @@ -29,6 +29,8 @@ from libcloud.compute.types import Provider, StorageVolumeState, VolumeSnapshotState from libcloud.compute.drivers.openstack import OpenStackKeyPair, OpenStackNodeDriver +from libcloud.libcloud.utils import logging + class OvhNodeDriver(NodeDriver): """ @@ -537,7 +539,10 @@ 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: + logging.warning(f"Unknown location {obj} for OVH") + location = {"id": obj, "name": obj, "country": ""} return NodeLocation(driver=self, **location) From ef3df6d8469fecbdbbc7e457e48ebdc25a863a44 Mon Sep 17 00:00:00 2001 From: ali-corpo Date: Tue, 17 Feb 2026 16:35:05 +0100 Subject: [PATCH 2/3] Update libcloud/common/ovh.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- libcloud/common/ovh.py | 1 - 1 file changed, 1 deletion(-) diff --git a/libcloud/common/ovh.py b/libcloud/common/ovh.py index 242aad219c..edf905dc9a 100644 --- a/libcloud/common/ovh.py +++ b/libcloud/common/ovh.py @@ -63,7 +63,6 @@ "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"}, From a26c7885f15c39fead846f8b1a7642aa78cfed8d Mon Sep 17 00:00:00 2001 From: ali-corpo Date: Tue, 17 Feb 2026 16:36:14 +0100 Subject: [PATCH 3/3] Remove logging for unknown OVH locations Removed logging warning for unknown OVH locations. --- libcloud/compute/drivers/ovh.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libcloud/compute/drivers/ovh.py b/libcloud/compute/drivers/ovh.py index cf07a8914c..a32eac519d 100644 --- a/libcloud/compute/drivers/ovh.py +++ b/libcloud/compute/drivers/ovh.py @@ -29,9 +29,6 @@ from libcloud.compute.types import Provider, StorageVolumeState, VolumeSnapshotState from libcloud.compute.drivers.openstack import OpenStackKeyPair, OpenStackNodeDriver -from libcloud.libcloud.utils import logging - - class OvhNodeDriver(NodeDriver): """ Libcloud driver for the Ovh API @@ -541,7 +538,6 @@ def _to_volumes(self, objs): def _to_location(self, obj): location = self.connectionCls.LOCATIONS.get(obj) if not location: - logging.warning(f"Unknown location {obj} for OVH") location = {"id": obj, "name": obj, "country": ""} return NodeLocation(driver=self, **location)