|
|
|
@ -73,11 +73,14 @@ class Cliconf(CliconfBase):
|
|
|
|
|
|
|
|
|
|
return device_info
|
|
|
|
|
|
|
|
|
|
def configure(self, admin=False):
|
|
|
|
|
def configure(self, admin=False, exclusive=False):
|
|
|
|
|
prompt = to_text(self._connection.get_prompt(), errors='surrogate_or_strict').strip()
|
|
|
|
|
if not prompt.endswith(')#'):
|
|
|
|
|
if admin and 'admin-' not in prompt:
|
|
|
|
|
self.send_command('admin')
|
|
|
|
|
if exclusive:
|
|
|
|
|
self.send_command('configure exclusive')
|
|
|
|
|
return
|
|
|
|
|
self.send_command('configure terminal')
|
|
|
|
|
|
|
|
|
|
def abort(self, admin=False):
|
|
|
|
@ -99,7 +102,7 @@ class Cliconf(CliconfBase):
|
|
|
|
|
|
|
|
|
|
return self.send_command(cmd)
|
|
|
|
|
|
|
|
|
|
def edit_config(self, candidate=None, commit=True, admin=False, replace=None, comment=None, label=None):
|
|
|
|
|
def edit_config(self, candidate=None, commit=True, admin=False, exclusive=False, replace=None, comment=None, label=None):
|
|
|
|
|
operations = self.get_device_operations()
|
|
|
|
|
self.check_edit_config_capability(operations, candidate, commit, replace, comment)
|
|
|
|
|
|
|
|
|
@ -107,7 +110,7 @@ class Cliconf(CliconfBase):
|
|
|
|
|
results = []
|
|
|
|
|
requests = []
|
|
|
|
|
|
|
|
|
|
self.configure(admin=admin)
|
|
|
|
|
self.configure(admin=admin, exclusive=exclusive)
|
|
|
|
|
|
|
|
|
|
if replace:
|
|
|
|
|
candidate = 'load {0}'.format(replace)
|
|
|
|
|