Updated pushover exception
This commit is contained in:
parent
5732951cde
commit
36b67cd116
@ -4,7 +4,6 @@ def build_cont_list(obj, hypercare_containers):
|
|||||||
for i, c in enumerate(obj):
|
for i, c in enumerate(obj):
|
||||||
if c["State"].lower() != "running":
|
if c["State"].lower() != "running":
|
||||||
if c["Names"][0].lstrip("/") in hypercare_containers:
|
if c["Names"][0].lstrip("/") in hypercare_containers:
|
||||||
#print(f'index: {i} container: {c["Names"][0].lstrip("/")} State: {c["State"]} ID: {c["Id"]}')
|
|
||||||
cont_list.append(c)
|
cont_list.append(c)
|
||||||
return cont_list
|
return cont_list
|
||||||
|
|
||||||
@ -12,7 +11,6 @@ def build_full_cont_list(obj, hypercare_containers):
|
|||||||
cont_full_list = []
|
cont_full_list = []
|
||||||
for i, c in enumerate(obj):
|
for i, c in enumerate(obj):
|
||||||
if c["Names"][0].lstrip("/") in hypercare_containers:
|
if c["Names"][0].lstrip("/") in hypercare_containers:
|
||||||
#print(f'index: {i} container: {c["Names"][0].lstrip("/")} State: {c["State"]} ID: {c["Id"]}')
|
|
||||||
cont_full_list.append(c)
|
cont_full_list.append(c)
|
||||||
return cont_full_list
|
return cont_full_list
|
||||||
|
|
||||||
@ -26,7 +24,6 @@ def process_cont_status(obj):
|
|||||||
if not obj:
|
if not obj:
|
||||||
return -1 # Can't find the containter
|
return -1 # Can't find the containter
|
||||||
for c in enumerate(obj):
|
for c in enumerate(obj):
|
||||||
# print(c[1]['Names'][0].lstrip("/"))
|
|
||||||
if 'running' in c[1]["State"].lower():
|
if 'running' in c[1]["State"].lower():
|
||||||
return 0
|
return 0
|
||||||
if c[1]["State"] != 'running':
|
if c[1]["State"] != 'running':
|
||||||
|
2
crane.py
2
crane.py
@ -58,7 +58,7 @@ class Crn:
|
|||||||
|
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
self.tl.exception(e)
|
self.tl.exception(e)
|
||||||
self.po.send_message(e, title="crane API ERROR")
|
self.poc.message(self.po_key, e, title="crane API ERROR")
|
||||||
|
|
||||||
#Main process block
|
#Main process block
|
||||||
self.et = datetime.datetime.now()
|
self.et = datetime.datetime.now()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user