a***@free.fr
2016-11-17 15:42:46 UTC
Hello,
I'm new here, and before writing this email I searched on the archives without success, so please excuse me if this question was already asked.
I'm trying to "display current-configuration" through ssh on HP 5820 series switches with this piece of code :
from fabric.api import *
env.user = 'toto'
env.hosts = ['192.168.72.10']
def displaycurr():
with settings(hide('warnings'), warn_only=True):
# below command is normally used to prevent the "more"
run('screen-length disable ', shell=False)
run('display current-configuration ', shell=False)
As written in the email's subject, every ran command returns a nonzero code, implying that even if I forced the "keep running" with the warn_only=True option, after each run command the ssh session is exited.
Therefore I lost the first command advantage and then I got the "more" during the second.
Same code (without warn_only) and the right Cisco commands does work well on Cisco switches.
By any chance, is there someone that experienced the same issue (not necessarily with HP switches) and managed to keep the ssh session opened between both commands?
Many Thanks,
Regards,
Alexandre
I'm new here, and before writing this email I searched on the archives without success, so please excuse me if this question was already asked.
I'm trying to "display current-configuration" through ssh on HP 5820 series switches with this piece of code :
from fabric.api import *
env.user = 'toto'
env.hosts = ['192.168.72.10']
def displaycurr():
with settings(hide('warnings'), warn_only=True):
# below command is normally used to prevent the "more"
run('screen-length disable ', shell=False)
run('display current-configuration ', shell=False)
As written in the email's subject, every ran command returns a nonzero code, implying that even if I forced the "keep running" with the warn_only=True option, after each run command the ssh session is exited.
Therefore I lost the first command advantage and then I got the "more" during the second.
Same code (without warn_only) and the right Cisco commands does work well on Cisco switches.
By any chance, is there someone that experienced the same issue (not necessarily with HP switches) and managed to keep the ssh session opened between both commands?
Many Thanks,
Regards,
Alexandre