-
Notifications
You must be signed in to change notification settings - Fork 927
new: add image creation support for OVH #2125
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 all commits
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NodeImage, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NodeDriver, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NodeLocation, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| NodeState, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| StorageVolume, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| VolumeSnapshot, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -210,7 +211,21 @@ def list_images(self, location=None, ex_size=None): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params["flavorId"] = ex_size.id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response = self.connection.request(action, params=params) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return self._to_images(response.object) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| public_images = self._to_images(response.object) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| action_snapshot = self._get_project_action("snapshot") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params_snapshot = {} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if location: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| params_snapshot["region"] = location.id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # if ex_size: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # params["flavorType"] = ex_size. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| response_snapshot = self.connection.request(action_snapshot, params=params_snapshot) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private_images = self._to_images(response_snapshot.object) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+216
to
+225
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| action_snapshot = self._get_project_action("snapshot") | |
| params_snapshot = {} | |
| if location: | |
| params_snapshot["region"] = location.id | |
| # if ex_size: | |
| # params["flavorType"] = ex_size. | |
| response_snapshot = self.connection.request(action_snapshot, params=params_snapshot) | |
| private_images = self._to_images(response_snapshot.object) | |
| try: | |
| action_snapshot = self._get_project_action("snapshot") | |
| params_snapshot = {} | |
| if location: | |
| params_snapshot["region"] = location.id | |
| # if ex_size: | |
| # params["flavorType"] = ex_size. | |
| response_snapshot = self.connection.request( | |
| action_snapshot, params=params_snapshot | |
| ) | |
| private_images = self._to_images(response_snapshot.object) | |
| except Exception: | |
| # If the snapshot endpoint is not available or not mocked, | |
| # gracefully fall back to no private images. | |
| private_images = [] |
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.
_to_image now unconditionally reads obj["status"], but the OVH image list/details responses used elsewhere in the driver (and in existing fixtures) don't include a status field. This will raise a KeyError when calling list_images() / get_image(). Use obj.get("status") (or a sensible default) and keep the extra fields optional.
| extra = {"region": obj["region"], "visibility": obj["visibility"], "status": obj["status"]} | |
| extra = {} | |
| for key in ("region", "visibility", "status"): | |
| if key in obj: | |
| extra[key] = obj[key] |
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.
Trailing whitespace at the end of this line should be removed to keep the file clean and avoid style/lint noise.
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.
There is commented-out/incomplete code left in this method (
# if ex_size:/params["flavorType"] = ex_size.). Since it can't work as-is and doesn't document an implemented behavior, it should be removed or replaced with a proper implementation and explanation.