Discussion:
[Fab-user] Running Non-UNIX CLI commands through Fabric
Rahul K
2016-11-22 08:41:22 UTC
Permalink
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.
Rahul K
2016-12-04 07:50:22 UTC
Permalink
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.
Rahul K
2016-12-04 07:52:12 UTC
Permalink
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.
Post by Rahul K
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.
Brandon Whaley
2016-12-05 02:08:13 UTC
Permalink
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.
Post by Rahul K
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.
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.
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
https://lists.nongnu.org/mailman/listinfo/fab-user
Loading...