[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] functionality suggestions
From: |
Jeff Forcier |
Subject: |
Re: [Fab-user] functionality suggestions |
Date: |
Fri, 12 Jun 2009 15:50:50 -0400 |
Hi Timothee,
On Fri, Jun 12, 2009 at 2:26 PM, Timothee Besset<address@hidden> wrote:
> - The user path expansion is not working, I suppose it could be made
> explicit, to handle local user != remote user.
We have tilde expansion working at least in put(); looks like it was
not extended to get(), which is a mistake and will be fixed now that
it has come to my attention :) FWIW this uses the Paramiko SFTP module
to do the tilde expansion, which appears to work pretty well.
> And the files are saved implicitly as 'authorized_keys.%s' %
> env.host_string, which I don't like much and have no control over.
Without this behavior in place, if you run the get() command on >1
host, only the final host's version of the file would end up on your
local machine -- each subsequent call to get() would overwrite
whatever was downloaded previously. Obviously not a good thing :)
We could add an option to get() allowing you to disable this behavior,
to save you the hassle of renaming afterwards; or we could introspect
env.hosts and only perform the suffixing if there's more than one
host, since I can only assume that's your situation. Offhand I prefer
the latter approach as it's less complexity in the API.
Anyone else have an opinion on this?
> As far as execution, I ran a command using the hosts='hostC;hostD;hostA'
> syntax. It is not running the command in the order given on the hosts
> line (it's either doing alphabetical sorting or no sorting at all).
No explicit sorting is being done, as far as I recall. However, the
host list does go through some transformations (mostly going from list
=> set => list again as various possible host-list sources get merged
in, deduped and turned back to a list) which might be changing around
the order, I'm not sure.
If you're willing to look at the source (it's very straightforward and
simple right now) check out fabric/main.py, specifically the functions
get_hosts() and _merge(). My guess is that the use of set() is the
culprit. Will look into this at some point.
> Problem with that is if one host fails and aborts, you can't easily know
> which hosts remain to be processed.
While host order is indeed important (at least in some use-cases),
this is almost an unrelated issue, and could be solved independently
by having Fabric track which hosts have been run / are running / have
not yet run, and then print the results of that during an abort.
I'll do this or make a TODO item for it soon; I tend to do most Fabric
work on the weekends, and thankfully one is imminent :)
Best,
Jeff