@ -37,7 +37,7 @@ class Cliconf(CliconfBase):
device_info = { }
device_info [ ' network_os ' ] = ' dellos6 '
reply = self . get ( b ' show version ' )
reply = self . get ( ' show version ' )
data = to_text ( reply , errors = ' surrogate_or_strict ' ) . strip ( )
match = re . search ( r ' Software Version ( \ S+) ' , data )
@ -48,7 +48,7 @@ class Cliconf(CliconfBase):
if match :
device_info [ ' network_os_model ' ] = match . group ( 1 )
reply = self . get ( b ' show running-config | grep hostname ' )
reply = self . get ( ' show running-config | grep hostname ' )
data = to_text ( reply , errors = ' surrogate_or_strict ' ) . strip ( )
match = re . search ( r ' ^hostname (.+) ' , data , re . M )
if match :
@ -61,14 +61,14 @@ class Cliconf(CliconfBase):
if source not in ( ' running ' , ' startup ' ) :
return self . invalid_params ( " fetching configuration from %s is not supported " % source )
# if source == 'running':
# cmd = b 'show running-config all'
# cmd = 'show running-config all'
else :
cmd = b ' show startup-config '
cmd = ' show startup-config '
return self . send_command ( cmd )
@enable_mode
def edit_config ( self , command ) :
for cmd in chain ( [ b ' configure terminal ' ] , to_list ( command ) , [ b ' end ' ] ) :
for cmd in chain ( [ ' configure terminal ' ] , to_list ( command ) , [ ' end ' ] ) :
self . send_command ( cmd )
def get ( self , command , prompt = None , answer = None , sendonly = False , check_all = False ) :