micafer commented on code in PR #2123:
URL: https://github.com/apache/libcloud/pull/2123#discussion_r2816527079
##########
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
Review Comment:
Remove logging import and calls, drivers do not call logging.
##########
libcloud/compute/drivers/ovh.py:
##########
@@ -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": ""}
Review Comment:
What's the logic behind the location being empty?
May be raising an error will be better...
##########
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"},
+
Review Comment:
Please remove trailing whitespaces.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]