fab-user
[Top][All Lists]
Advanced

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

[Fab-user] HP switches and run() received nonzero return code -1 while e


From: a . hocquel
Subject: [Fab-user] HP switches and run() received nonzero return code -1 while executing
Date: Thu, 17 Nov 2016 16:42:46 +0100 (CET)

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


 



reply via email to

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