Run a Proxmox VE command.
(cmd: List[str], timeout: int = 60)
| 207 | |
| 208 | |
| 209 | def _run_pve_cmd(cmd: List[str], timeout: int = 60) -> Tuple[int, str, str]: |
| 210 | """Run a Proxmox VE command.""" |
| 211 | try: |
| 212 | proc = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout) |
| 213 | return proc.returncode, proc.stdout.strip(), proc.stderr.strip() |
| 214 | except subprocess.TimeoutExpired: |
| 215 | return -1, "", "Command timed out" |
| 216 | except Exception as e: |
| 217 | return -1, "", str(e) |
| 218 | |
| 219 | |
| 220 | # ================================================================= |
no outgoing calls
no test coverage detected