[WiP] Added Cloud configuration check for proxy and setting up (if required)
This commit is contained in:
@@ -38,18 +38,12 @@ def execute_ssh_command(ip, command, client):
|
||||
stdin, stdout, stderr = client.exec_command(command, timeout=180)
|
||||
exit_status = stdout.channel.recv_exit_status()
|
||||
|
||||
result = stdout.read().decode().lower().strip()
|
||||
error = stderr.read().decode('utf-8')
|
||||
stdout_line = [line for line in stdout]
|
||||
for output in stdout_line:
|
||||
print(output.strip())
|
||||
|
||||
if exit_status == 0:
|
||||
print(f"✅")
|
||||
else:
|
||||
print(f"❌")
|
||||
print(f"{error}")
|
||||
raise Exception(f"{str(error)}")
|
||||
return result
|
||||
except Exception as e:
|
||||
print(f"SSH error: {str(e)} --- {str(error)}", flush=True)
|
||||
print(f"SSH error: {str(e)}", flush=True)
|
||||
raise
|
||||
finally:
|
||||
client.close()
|
||||
@@ -147,8 +141,8 @@ def main():
|
||||
continue
|
||||
|
||||
try:
|
||||
result = execute_ssh_command(ip_address, "cat /etc/cube", client)
|
||||
print(f"{result}", flush=True)
|
||||
#result = execute_ssh_command(ip_address, "cat /etc/cube/config-azure.properties", client)
|
||||
print(f"coucou", flush=True)
|
||||
except Exception as e:
|
||||
print(f"Error getting Cloud settings for {cube_id}.", flush=True)
|
||||
print(f"{e}", flush=True)
|
||||
|
||||
Reference in New Issue
Block a user