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:
openhands 2025-11-06 20:19:55 +00:00
parent 2f94c083b9
commit 11baac8f21
1 changed files with 7 additions and 5 deletions

View File

@ -83,26 +83,28 @@ 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()
print(f"{description} failed: {error_output}") if not silent:
print(f"{description} failed: {error_output}")
return False return False
except Exception as e: except Exception as e:
print(f"{description} failed: {e}") if not silent:
print(f"{description} failed: {e}")
return False return False
def transfer_file(self, local_path: str, remote_path: str, description: str = "") -> bool: def transfer_file(self, local_path: str, remote_path: str, description: str = "") -> bool: