On Linux Machine A, i have a script running which is supposed to ssh into Linux Machine B, sync the p4 workspace on B and then execute a piece of code.
I've set up Perforce on B and I'm able to manually execute p4 client
and other commands on B and they work.
However, when i attempt to do the same thing while sshing from Machine A, i get the following error:
Perforce client error: Connect to server failed; check $P4PORT. TCP connect to perforce:1666 failed. Temporary failure in name resolution
Here's my piece of code:
def ssh_connect(ip,user,pwd):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(ip, username=user, password=pwd)
return ssh
def execute_command(device_details, command):
try:
ip = device_details.get('ip')
username = device_details.get('username')
password = device_details.get('password')
ssh_ns_obj = ssh_connect(ip, username, password)
ssh_stdin, ssh_stdout, ssh_stderr = ssh_ns_obj.exec_command(command)
print ssh_stdout.read()
print ssh_stderr.read()
print ssh_stdin.read()
return ssh_stdout.read()
except Exception as e:
print_exception_details()
perforce_sync_command = "cd /root/hello/;chmod -R 444 *;p4 sync ...;chmod -R 755 *"
output = execute_command(device_details, perforce_sync_command)
What am i missing?