extension: proxmox: rewrite in python3 - #13832
Conversation
There was a problem hiding this comment.
Pull request overview
This PR rewrites the Proxmox extension implementation from a Bash script to a Python 3 script, aiming to improve maintainability and reduce reliance on shell tooling.
Changes:
- Removed the legacy
proxmox.shBash-based extension implementation. - Added a new
proxmox.pyPython-based implementation covering lifecycle actions (prepare/create/start/stop/reboot/delete/status/statuses), console retrieval, and snapshot operations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| extensions/Proxmox/proxmox.sh | Removed the previous Bash implementation of the Proxmox extension. |
| extensions/Proxmox/proxmox.py | Added a Python implementation for Proxmox extension operations, including VM lifecycle, console access, and snapshot management. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| #!/usr/bin/env python3 | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file |
| class ProxmoxManager: | ||
| def __init__(self, config_path: str, wait_time: int | None = None): | ||
| self.config_path = config_path | ||
| self.wait_time = ( | ||
| wait_time if wait_time and wait_time > 0 else DEFAULT_WAIT_SECONDS |
| def _is_mapping(value: Any) -> bool: | ||
| return isinstance(value, dict) | ||
|
|
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## main #13832 +/- ##
=============================================
- Coverage 19.64% 3.41% -16.24%
=============================================
Files 6368 487 -5881
Lines 574889 41867 -533022
Branches 70353 7912 -62441
=============================================
- Hits 112962 1429 -111533
+ Misses 449656 40238 -409418
+ Partials 12271 200 -12071
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
this PR rewrites the proxmox extension from shell to modern python3 for better maintainability.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?