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
This commit is contained in:
Nathaniel Case 2017-12-14 09:51:41 -05:00 committed by GitHub
parent 5578193ae4
commit 67a8ff47aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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']

View file

@ -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,