fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Fwd: Running Non-UNIX CLI commands through Fabric


From: Brandon Whaley
Subject: Re: [Fab-user] Fwd: Running Non-UNIX CLI commands through Fabric
Date: Mon, 05 Dec 2016 02:08:13 +0000

You can set env.use_shell to False but every run() call is going to be isolated to its own shell session.  Fabric does not work like an interactive session and in use cases where the endpoint does not act like a standard *nix system, you can have unexpected results.  See the FAQ here: http://www.fabfile.org/faq.html#my-cd-workon-export-etc-calls-don-t-seem-to-work

There's much detail in the FAQ, you should read it all if you want to know details about Fabric's operation.

On Sun, Dec 4, 2016 at 2:52 AM Rahul K <address@hidden> wrote:


I am using the latest Fabric API to establish SSH connections. In my case, SSH-ing to the server opens up a CLI (like the ones Routers have). I need to execute 'enable' command followed by '_shell' command in-order to finally open up a UNIX shell. The problem here is that I am unable to automate these specific commands using Fabric. I have tried the 'shell=False' parameter for the run() function.

How do we solve this problem. please help me out.

Error : 

out: UNIX shell commands cannot be executed using this account.

Fatal error: run() received nonzero return code 1 while executing!

Requested: en

Executed: /bin/bash -l -c "en"

Waiting for your positive response.


On 4 Dec 2016 1:20 p.m., "Rahul K" <address@hidden> wrote:

Hello,

I am using the latest Fabric API to establish SSH connections. In my case, SSH-ing to the server opens up a CLI (like the ones Routers have). I need to execute 'enable' command followed by '_shell' command in-order to finally open up a UNIX shell. The problem here is that I am unable to automate these specific commands using Fabric. I have tried the 'shell=False' parameter for the run() function.

_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user

reply via email to

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