Add 1 as valid exit code for pod exists check

This commit is contained in:
Benedikt Ziemons 2020-11-19 00:54:21 +01:00
parent 5338563299
commit 7d461546aa
Signed by: ben
GPG key ID: 0F54A7ED232D3319

View file

@ -54,7 +54,7 @@ class PodKeeper:
def run(self):
os.chdir(self.podhome)
if self.stop_previous and podman.pod.exists(self.podname).exit_code == 0:
if self.stop_previous and podman.pod.exists(self.podname, _ok_code=[0, 1]).exit_code == 0:
print(f"Stopping pod {self.podname}", file=sys.stderr, flush=True)
podman.pod.stop(self.podname)