fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Rsync_project in 1.5.1


From: Carl E. Ma
Subject: Re: [Fab-user] Rsync_project in 1.5.1
Date: Fri, 7 Dec 2012 13:01:36 -0800 (PST)

Hi Chris,

Thanks for your reply! The wrong format of env.host_string is the root cause of my failure. After correcting it per your suggestion, everything is working like charm!  Here is the error I got before.

Cheers,

carl

***********************
Traceback (most recent call last):
  File "./fabfile.py", line 30, in <module>
    rsync_project ("/tmp/ssh", "/etc/ssh/" + FileSrc)
  File "/usr/local/lib/python2.7/dist-packages/fabric/network.py", line 523, in host_prompting_wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/fabric/contrib/project.py", line 120, in rsync_project
    if env.host.count(':') > 1:
AttributeError: 'NoneType' object has no attribute 'count'
**************************  


From: 686f6c6d <address@hidden>
To: Carl E. Ma <address@hidden>
Cc: Jeff Forcier <address@hidden>; "address@hidden" <address@hidden>
Sent: Friday, December 7, 2012 3:31:50 PM
Subject: Re: [Fab-user] Rsync_project in 1.5.1

Greetings,

please note you forgot to provide a (sanitized) log of an actual
fabric run containing the verbatim error message and possible
traceback, so it is very hard for us to debug your problem.

However, from the way you add "userXXX@" to env.host_string in your
os.system call, I assume your host_string is just missing the user
portion[0][1][2]. Unless it is identical to your local username, this
will be a problem since local_username is the default value for the
remote username[3][4].


[0]: The docs (http://docs.fabfile.org/en/1.4.3/usage/env.html#host-string)
could be a bit clearer on that, and are lacking examples. I haven't
verified it recently, but the way I understand and use it in my code,
basically,
    [code]env.host_string = env.user + '@' + env.host[/code].
[1]: https://github.com/fabric/fabric/blob/master/fabric/network.py#L199
[2]: https://github.com/fabric/fabric/blob/master/fabric/network.py#L177
[3]: http://docs.fabfile.org/en/1.4.3/usage/env.html#user
[4]: http://docs.fabfile.org/en/1.4.3/usage/env.html#local-user


--
Kind regards
    Christopher 'm4z' Holm / 686f6c6d

"We must respect the other fellow's religion, but only in the sense
and to the extent that we respect his theory that his wife is
beautiful and his children smart." --H. L. Mencken



reply via email to

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