I'm executing gcloud command inside the remote host. However, when I try to execute any command using the ssh.exec_command, the command seems to get executed. But how can I make sure it executed correctly.
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(hostname = HOSTNAME,username = USERNAME,key_filename = FILENAME)
firewall_list = [gke-cluster-XXX-all,gke-cluster-XXX-ssh,gke-cluster-XXX-vms]
cmd = 'gcloud compute firewall-rules delete'+firewall_list
stdin,stdout,stderr = ssh.exec_command(cmd)
ssh.close()
How can I check ssh.exec_command executed successfully?
Thanks