@ -55,18 +55,18 @@ class Cliconf(CliconfBase):
return self . send_command ( b ' show configuration commands ' )
return self . send_command ( b ' show configuration commands ' )
def edit_config ( self , command ) :
def edit_config ( self , command ) :
for cmd in chain ( [ b ' configure ' ] , to_list ( command ) ) :
for cmd in chain ( [ ' configure ' ] , to_list ( command ) ) :
self . send_command ( cmd)
self . send_command ( to_bytes( cmd) )
def get ( self , command , prompt = None , answer = None , sendonly = False ) :
def get ( self , command , prompt = None , answer = None , sendonly = False ) :
return self . send_command ( to_bytes ( command ) , prompt = to_bytes ( prompt ) , answer = to_bytes ( answer ) , sendonly = sendonly )
return self . send_command ( to_bytes ( command ) , prompt = to_bytes ( prompt ) , answer = to_bytes ( answer ) , sendonly = sendonly )
def commit ( self , comment = None ) :
def commit ( self , comment = None ) :
if comment :
if comment :
command = b ' commit comment " {0} " ' . format ( comment )
command = ' commit comment " {0} " ' . format ( comment )
else :
else :
command = b ' commit '
command = ' commit '
self . send_command ( command)
self . send_command ( to_bytes( command) )
def discard_changes ( self , * args , * * kwargs ) :
def discard_changes ( self , * args , * * kwargs ) :
self . send_command ( b ' discard ' )
self . send_command ( b ' discard ' )