multiple evolutions

This commit is contained in:
Quentin WEPHRE
2025-12-04 08:11:00 +01:00
parent e9715dc239
commit abd00f9e04
9 changed files with 403 additions and 264 deletions

View File

@@ -87,7 +87,7 @@ def set_ssh_status(base_url, token):
else:
raise
def activate_ssh(ip_address):
def activate_ssh(ip_address, silent = False):
# Ensure the URL uses HTTPS
url = ip_address
@@ -104,17 +104,23 @@ def activate_ssh(ip_address):
if not verify_ssl:
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
print(f"HTTPS", end=" ", flush=True)
if not silent:
print(f"HTTPS", end=" ", flush=True)
try:
token = authenticate(url)
print(f"", end="", flush=True)
if not silent:
print(f"", end="", flush=True)
except Exception as e:
print(f"", flush=True)
if not silent:
print(f"", flush=True)
raise
print(f"SSH", end=" ", flush=True)
if not silent:
print(f"SSH", end=" ", flush=True)
try:
set_ssh_status(url, token)
print(f"", end="\n", flush=True)
if not silent:
print(f"", end="\n", flush=True)
except Exception as e:
print(f"", flush=True)
if not silent:
print(f"", flush=True)
raise