@ -94,13 +94,14 @@ class CliconfBase(with_metaclass(ABCMeta, object)):
display . display ( ' closing shell due to command timeout ( %s seconds). ' % self . _connection . _play_context . timeout , log_only = True )
display . display ( ' closing shell due to command timeout ( %s seconds). ' % self . _connection . _play_context . timeout , log_only = True )
self . close ( )
self . close ( )
def send_command ( self , command , prompt = None , answer = None , sendonly = False ):
def send_command ( self , command , prompt = None , answer = None , sendonly = False , newline = True ):
""" Executes a cli command and returns the results
""" Executes a cli command and returns the results
This method will execute the CLI command on the connection and return
This method will execute the CLI command on the connection and return
the results to the caller . The command output will be returned as a
the results to the caller . The command output will be returned as a
string
string
"""
"""
kwargs = { ' command ' : to_bytes ( command ) , ' sendonly ' : sendonly }
kwargs = { ' command ' : to_bytes ( command ) , ' sendonly ' : sendonly ,
' newline ' : newline }
if prompt is not None :
if prompt is not None :
kwargs [ ' prompt ' ] = to_bytes ( prompt )
kwargs [ ' prompt ' ] = to_bytes ( prompt )
if answer is not None :
if answer is not None :