-
Notifications
You must be signed in to change notification settings - Fork 929
add more location to OVH and avoid exception when location is not in the list #2123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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"}, | ||||||||||
|
Comment on lines
+80
to
+81
|
||||||||||
| "UK": {"id": "UK", "name": "United Kingdom", "country": "UK"}, | |
| "UK1": {"id": "UK1", "name": "United Kingdom 1", "country": "UK"}, | |
| "UK": {"id": "UK", "name": "United Kingdom", "country": "GB"}, | |
| "UK1": {"id": "UK1", "name": "United Kingdom 1", "country": "GB"}, |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||
|
||||||
| from libcloud.libcloud.utils import logging | |
| import logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove logging import and calls, drivers do not call logging.
Outdated
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fixing the import statement, you should create a module-level logger instance (e.g., logger = logging.getLogger(__name__)) and use logger.warning() instead of calling logging.warning() directly. This follows the established pattern in the codebase (see libcloud/compute/drivers/vsphere.py:53 and libcloud/common/google.py:103).
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new fallback logic for unknown locations lacks test coverage. Consider adding a test case that verifies the behavior when an unknown location is encountered, ensuring that it creates a NodeLocation with the location ID as both id and name, an empty country field, and logs an appropriate warning message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the logic behind the location being empty?
May be raising an error will be better...
Uh oh!
There was an error while loading. Please reload this page.