mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-03-14 23:00:01 +01:00
build
This commit is contained in:
@@ -1025,6 +1025,7 @@ class PortainerApi:
|
|||||||
#print(longest)
|
#print(longest)
|
||||||
ok = "\033[92m✔\033[0m"
|
ok = "\033[92m✔\033[0m"
|
||||||
err = "\033[91m✖\033[0m"
|
err = "\033[91m✖\033[0m"
|
||||||
|
service_to_update = []
|
||||||
for service_id in service_ids:
|
for service_id in service_ids:
|
||||||
print("\033[?25l", end="")
|
print("\033[?25l", end="")
|
||||||
print(f"{service_dict[service_id]:<{longest}} ", end="", flush=True)
|
print(f"{service_dict[service_id]:<{longest}} ", end="", flush=True)
|
||||||
@@ -1037,20 +1038,23 @@ class PortainerApi:
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
if resp['Status'] == "outdated":
|
if resp['Status'] == "outdated":
|
||||||
|
service_to_update.append(service_dict[service_id])
|
||||||
if pull:
|
if pull:
|
||||||
if service_dict[service_id] in self.args.excluded:
|
if service_dict[service_id] in self.args.excluded:
|
||||||
continue
|
continue
|
||||||
self.restart_srv(service_id, pull)
|
self.restart_srv(service_id, pull)
|
||||||
#print(f"Service {service_dict[service_id]:<{longest}} : updated")
|
#print(f"Service {service_dict[service_id]:<{longest}} : updated")
|
||||||
self.gotify_message(f"Service {service_dict[service_id]} updated")
|
|
||||||
print(f"{ok} updated")
|
print(f"{ok} updated")
|
||||||
else:
|
else:
|
||||||
print(f"\r\033[4m{service_dict[service_id]:<{longest}}\033[0m ", end="", flush=True)
|
print(f"\r\033[4m{service_dict[service_id]:<{longest}}\033[0m ", end="", flush=True)
|
||||||
#print(f"\033[4m{service_dict[service_id]:<{longest}} {err}\033[0m")
|
#print(f"\033[4m{service_dict[service_id]:<{longest}} {err}\033[0m")
|
||||||
self.gotify_message(f"Service update available for {service_dict[service_id]}")
|
|
||||||
print(err)
|
print(err)
|
||||||
else:
|
else:
|
||||||
print(ok)
|
print(ok)
|
||||||
|
if pull:
|
||||||
|
self.gotify_message(f"Services updated: {', '.join(service_to_update)}")
|
||||||
|
else:
|
||||||
|
self.gotify_message(f"Service update available: {', '.join(service_to_update)}")
|
||||||
self.gotify_message(f"Service update process finished")
|
self.gotify_message(f"Service update process finished")
|
||||||
print("\033[?25h", end="")
|
print("\033[?25h", end="")
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user