Muhammad Nouman Shahzad
2015-07-10 07:19:23 UTC
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.
Here is an image of the commands I am running, followed by the error being
generated:
[image: Inline image 1]
[image: Inline image 2]
I have been trying different stuff but still haven't been able to solve
this problem through Fabric.
The equivalent implementation using a bash script is as follows:
[image: Inline image 3]
Regards,
M. Nouman Shahzad | Software Engineer | Ebryx Pvt. Ltd.
Cell: +92-323-4292169 | Skype ID: m.noumanshahzad
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.
Here is an image of the commands I am running, followed by the error being
generated:
[image: Inline image 1]
[image: Inline image 2]
I have been trying different stuff but still haven't been able to solve
this problem through Fabric.
The equivalent implementation using a bash script is as follows:
[image: Inline image 3]
Regards,
M. Nouman Shahzad | Software Engineer | Ebryx Pvt. Ltd.
Cell: +92-323-4292169 | Skype ID: m.noumanshahzad