Promote get_prompt to live in network_cli instead of cliconf (#33880)

This removes the immediate need for a cliconf plugin to use network_cli
pull/25180/merge
Nathaniel Case 7 years ago committed by GitHub
parent 5578193ae4
commit 67a8ff47aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -106,10 +106,6 @@ class CliconfBase(with_metaclass(ABCMeta, object)):
signal.alarm(0)
return resp
def get_prompt(self):
"""Returns the current prompt from the device"""
return self._connection._matched_prompt
def get_base_rpc(self):
"""Returns list of base rpc method supported by remote device"""
return ['get_config', 'edit_config', 'get_capabilities', 'get']

@ -106,6 +106,10 @@ class Connection(ConnectionBase):
raise AttributeError("'%s' object has no attribute '%s'" % (self.__class__.__name__, name))
return getattr(self._cliconf, name)
def get_prompt(self):
"""Returns the current prompt from the device"""
return self._matched_prompt
def exec_command(self, cmd, in_data=None, sudoable=True):
# this try..except block is just to handle the transition to supporting
# network_cli as a toplevel connection. Once connection=local is gone,

Loading…
Cancel
Save