diff --git a/.gitignore b/.gitignore index 6e31d5d..073488f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.json *.csv *.toml +.vscode/ # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/cprocess.py b/cprocess.py index 433d8c6..7429337 100644 --- a/cprocess.py +++ b/cprocess.py @@ -3,8 +3,9 @@ def build_cont_list(obj, hypercare_containers): cont_list = [] for i, c in enumerate(obj): if c["State"].lower() != "running": - if c["Names"][0].lstrip("/") in hypercare_containers: - cont_list.append(c) + continue + if c["Names"][0].lstrip("/") in hypercare_containers: + cont_list.append(c) return cont_list def build_full_cont_list(obj, hypercare_containers): diff --git a/crane.py b/crane.py index ac4d097..da83e20 100644 --- a/crane.py +++ b/crane.py @@ -54,7 +54,7 @@ class Crn: self.tl.debug('Building container list.') self.process_cont_list_response = process_cont_list(self.cont_list, c_start_container, self.cc, self.host, self.port, self.jwt, self.endpoint) if self.process_cont_list_response: - self.tl.warn(f'Started: [{self.process_cont_list_response}]') + self.tl.warning(f'Started: [{self.process_cont_list_response}]') except requests.exceptions.RequestException as e: self.tl.exception(e) diff --git a/test_pushover.py b/test_pushover.py index 1e8358d..dc1f72f 100644 --- a/test_pushover.py +++ b/test_pushover.py @@ -9,4 +9,4 @@ po_token = config["pushover"]["po_token"] message = "hello" -pushover.Pushover(po_token).message(po_key, message, title="--- crane summary ---") \ No newline at end of file +# pushover.Pushover(po_token).message(po_key, message, title="--- crane summary ---") \ No newline at end of file