fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] get operation is mangling file names


From: Erik Wickstrom
Subject: Re: [Fab-user] get operation is mangling file names
Date: Tue, 28 Jul 2009 10:56:28 -0700

I think there may in fact be a bug. (or 2)

1)  I do have multiple hosts defined in the fabfile, but only one for
that function (fab cloud x -- I also have some hosts in a
productionI() method).

2)  The docs say "while local_path may be a directory (in which case
the remote filename is preserved)".  When I have it download to a
directory, I get .ftp2.ftptoyoursite.com in that directory instead of
test.txt.ftp2.ftptoyoursite.com.

Erik

On Tue, Jul 28, 2009 at 10:26 AM, Jeff Forcier<address@hidden> wrote:
> On Tue, Jul 28, 2009 at 1:20 PM, Christian Vest
> Hansen<address@hidden> wrote:
>> This is by design, actually. If you have multiple hosts and the file
>> you want to get is not exactly the same on very host, then 'get' end
>> up picking one of them.
>
> Put another way, if you have >1 host and get() did *not* use this
> hostname suffix approach, you would end up with only one copy of the
> file, the one from the last host in the list, because each subsequent
> iteration would overwrite the previous file.
>
>> If you are using fabric 0.1.1, then 'get' will always do name
>> mangling, but I think Jeff changed that behavior at some point (for
>> the 0.9'ish versions) so that name mangling only happens when there is
>> more than one host.
>
> This is correct -- so if Erik's given snippet is what he's actually
> using, and there's only one host involved, there may be a bug in that
> new behavior. Let me know!
>
> Either way, post-0.9 I'd be open for modifying get() to be more
> flexible, such as storing downloaded files in per-host directories or
> something like that (as an option.) In general, I hope to overhaul the
> host mechanisms so that complex scripts that do a lot of file transfer
> and state-keeping, have an easier time keeping per-host information
> distinct -- and that would definitely involve get().
>
> Best,
> Jeff
>
>>
>> On Tue, Jul 28, 2009 at 6:52 PM, Erik Wickstrom<address@hidden> wrote:
>>> Hi,
>>>
>>> I'm testing Fabric with Rackspace Cloud Sites, which is an environment
>>> without SSH access but it does have SFTP.  Fabric's put operation
>>> seems to work correctly, however "get" is naming the files incorrectly
>>> on the local system.
>>>
>>> def cloud():
>>>    env.hosts = ['address@hidden']
>>>    env.password = '********'
>>>
>>> def x():
>>>    get('www.test.com/test.txt', './test/')
>>>
>>> When I run "fab cloud x", test.txt is downloaded into my local test
>>> directory, but the file is named .ftp2.ftptoyoursite.com
>>> (./test/.ftp2.ftptoyoursite.com)
>>>
>>> When I tell "get" to download to "test.txt" I end up with
>>> test.txt.ftp2.ftptoyoursite.com.
>>>
>>> Any suggestions?
>>>
>>> Thanks!
>>> Erik
>>>
>>>
>>> _______________________________________________
>>> Fab-user mailing list
>>> address@hidden
>>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>>
>>
>>
>>
>> --
>> Venlig hilsen / Kind regards,
>> Christian Vest Hansen.
>>
>>
>> _______________________________________________
>> Fab-user mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>




reply via email to

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