diff --git a/.idea/podlaunch.iml b/.idea/podlaunch.iml index d0876a7..969bacc 100644 --- a/.idea/podlaunch.iml +++ b/.idea/podlaunch.iml @@ -2,7 +2,7 @@ - + \ No newline at end of file diff --git a/main.py b/main.py index 87f54f3..b55ca7b 100644 --- a/main.py +++ b/main.py @@ -76,6 +76,10 @@ class PodKeeper: print(f"Starting pod {self.podname} at {self.last_check}", file=sys.stderr, flush=True) shlog.podman.play.kube(self.podyaml, *self.podnet_args) try: + shlogger = logging.getLogger("sh.command") + oldlevel = shlogger.level + shlogger.setLevel(logging.ERROR) + if 'NOTIFY_SOCKET' in os.environ: sdnotify("--ready", f"--pid={os.getpid()}", "--status=Monitoring pod...") @@ -99,6 +103,8 @@ class PodKeeper: if 'NOTIFY_SOCKET' in os.environ: sdnotify("--status=Stopping pod") + + logging.getLogger("sh.command").setLevel(oldlevel) finally: self.stop_pod()