fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Keeping remote path (or remote context) for next command


From: Jeff Forcier
Subject: Re: [Fab-user] Keeping remote path (or remote context) for next command
Date: Fri, 13 Feb 2015 15:00:53 -0800

Executing commands over SSH doesn't keep a real shell around (this is
true for other SSH automation too - think of it as a series of "ssh
<hostname> <command>" calls in your shell).

So - typically you have to fake it by generating prefixed commands.
E.g. Fabric's cd() helper just updates run() calls within its block so
they all actually start with "cd <path> && ...".

You can do this with arbitrary commands by using the prefix() helper -
http://docs.fabfile.org/en/1.10/api/core/context_managers.html#fabric.context_managers.prefix

Best,
Jeff

On Fri, Feb 13, 2015 at 5:36 AM, Jörg Schneider <address@hidden> wrote:
> For managing some network devices I have to send something like „configure“ 
> command at first before I can do the real magic with fab.
> Does fabric „keep“ the remote context (or „path" if you see it as „cd 
> something“)?
>
> J. Schneider
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fab-user



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

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