fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] Gateway problems with put (monkeypatch)


From: Antônio Theóphilo
Subject: [Fab-user] Gateway problems with put (monkeypatch)
Date: Fri, 2 Mar 2012 14:55:55 -0300 (BRT)

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='address@hidden',
                  gateway='address@hidden,
                  warn_only=True):
        run('uname -a')
        run('ls -l /tmp')

@task
def put_test():
    with settings(host_string='address@hidden',
                  gateway='address@hidden',
                  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]