Hi all 


In our environment we need to use the gateway feature. We are using it 
accordingly to https://github.com/fabric/fabric/issues/38 and everything works 
normal when using the run function but when using the put function it breaks. 
Has anyone encountered this problem or know how to solve it? 


Below are the error and a simple code that illustrate how we are using it, task 
cmd_test works but put_test doesn't: 



from fabric.api import task,settings,run,put 


@task 
def cmd_test(): 
with settings(host_string='user@target', 
gateway='user@gtw, 
warn_only=True): 
run('uname -a') 
run('ls -l /tmp') 


@task 
def put_test(): 
with settings(host_string='user@target', 
gateway='user@gtw', 
warn_only=True): 
put('./put_test', '/tmp/put_test') 





Traceback (most recent call last): 
File "/usr/local/lib/python2.6/dist-packages/fabric/main.py", line 713, in main 
*args, **kwargs 
File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 321, in 
execute 
results['<local-only>'] = task.run(*args, **new_kwargs) 
File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 113, in run 
return self.wrapped(*args, **kwargs) 
File "/home/autoconf/fabric/temp/gateway_test.py", line 17, in put_test 
put('./put_test', '/tmp/put_test') 
File "/usr/local/lib/python2.6/dist-packages/fabric/network.py", line 457, in 
host_prompting_wrapper 
return func(*args, **kwargs) 
File "/usr/local/lib/python2.6/dist-packages/fabric/operations.py", line 337, 
in put 
ftp = SFTP(env.host_string) 
File "/usr/local/lib/python2.6/dist-packages/fabric/sftp.py", line 19, in 
__init__ 
self.ftp = connections[host_string].open_sftp() 
File "/usr/local/lib/python2.6/dist-packages/fabric/network.py", line 84, in 
__getitem__ 
self.connect(key) 
File "/usr/local/lib/python2.6/dist-packages/fabric/network.py", line 76, in 
connect 
self[key] = connect(user, host, port) 
File "/usr/local/lib/python2.6/dist-packages/fabric/network.py", line 393, in 
connect 
raise NetworkError(msg, e) 
fabric.exceptions.NetworkError: Timed out trying to connect to target (tried 1 
time) 


Regards Antônio Theóphilo 






_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to