Fix deployment script health check bug
Fixed TypeError in SSHDeployer.execute_remote() method by adding 'silent' parameter - Added silent parameter with default value False - Modified print statements to respect silent mode - Health checks now work correctly during deployment This ensures the deployment script can properly wait for services to start and validate the deployment
This commit is contained in:
parent
2f94c083b9
commit
11baac8f21
|
|
@ -83,25 +83,27 @@ class SSHDeployer:
|
||||||
print(f"❌ SSH connection failed: {e}")
|
print(f"❌ SSH connection failed: {e}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def execute_remote(self, command: str, description: str = "") -> bool:
|
def execute_remote(self, command: str, description: str = "", silent: bool = False) -> bool:
|
||||||
"""Execute command on remote server"""
|
"""Execute command on remote server"""
|
||||||
try:
|
try:
|
||||||
if description:
|
if description and not silent:
|
||||||
print(f"🔧 {description}")
|
print(f"🔧 {description}")
|
||||||
|
|
||||||
stdin, stdout, stderr = self.ssh_client.exec_command(command)
|
stdin, stdout, stderr = self.ssh_client.exec_command(command)
|
||||||
exit_status = stdout.channel.recv_exit_status()
|
exit_status = stdout.channel.recv_exit_status()
|
||||||
|
|
||||||
if exit_status == 0:
|
if exit_status == 0:
|
||||||
if description:
|
if description and not silent:
|
||||||
print(f" ✅ {description} completed")
|
print(f" ✅ {description} completed")
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
error_output = stderr.read().decode()
|
error_output = stderr.read().decode()
|
||||||
|
if not silent:
|
||||||
print(f" ❌ {description} failed: {error_output}")
|
print(f" ❌ {description} failed: {error_output}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
if not silent:
|
||||||
print(f" ❌ {description} failed: {e}")
|
print(f" ❌ {description} failed: {e}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue