|
|
@@ -89,14 +89,10 @@ class Podman:
|
|
|
out = subprocess.check_output(args, **kwargs)
|
|
|
print(out.decode())
|
|
|
|
|
|
- @classmethod
|
|
|
- def ps(cls):
|
|
|
- out = subprocess.run(["podman", "ps"], capture_output=True, check=True)
|
|
|
-
|
|
|
@classmethod
|
|
|
def machine_is_running(cls) -> bool:
|
|
|
try:
|
|
|
- cls.ps()
|
|
|
+ subprocess.run(["podman", "ps"], capture_output=True, check=True)
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
if "Cannot connect to Podman" in e.stderr.decode():
|
|
|
return False
|
|
|
@@ -119,7 +115,7 @@ class Podman:
|
|
|
try:
|
|
|
run_and_output()
|
|
|
except subprocess.CalledProcessError as e:
|
|
|
- if not cls.machine_is_running:
|
|
|
+ if not cls.machine_is_running():
|
|
|
print("podman not running, starting it")
|
|
|
cls.machine_start()
|
|
|
run_and_output()
|