mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
parent
076a821821
commit
036650cb09
1 changed files with 4 additions and 5 deletions
|
@ -19,7 +19,6 @@
|
||||||
import re
|
import re
|
||||||
import shlex
|
import shlex
|
||||||
|
|
||||||
import re
|
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
|
|
||||||
from ansible.module_utils.pycompat24 import get_exception
|
from ansible.module_utils.pycompat24 import get_exception
|
||||||
|
@ -175,7 +174,7 @@ class Netconf(object):
|
||||||
self.lock_config()
|
self.lock_config()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
candidate = '\n'.join(candidate)
|
candidate = '\n'.join(config)
|
||||||
self.config.load(candidate, format=config_format, merge=merge,
|
self.config.load(candidate, format=config_format, merge=merge,
|
||||||
overwrite=overwrite)
|
overwrite=overwrite)
|
||||||
|
|
||||||
|
@ -242,7 +241,7 @@ class Netconf(object):
|
||||||
self.config.rollback(identifier)
|
self.config.rollback(identifier)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
exc = get_exception()
|
exc = get_exception()
|
||||||
self._error('Unable to rollback config: $s' % str(exc))
|
self.raise_exc('Unable to rollback config: $s' % str(exc))
|
||||||
|
|
||||||
diff = self.config.diff()
|
diff = self.config.diff()
|
||||||
if commit:
|
if commit:
|
||||||
|
@ -271,12 +270,12 @@ class Cli(CliBase):
|
||||||
self.execute('cli')
|
self.execute('cli')
|
||||||
self.execute('set cli screen-length 0')
|
self.execute('set cli screen-length 0')
|
||||||
|
|
||||||
def configure(self, commands, comment=None):
|
def configure(self, commands, comment=None, **kwargs):
|
||||||
cmds = ['configure']
|
cmds = ['configure']
|
||||||
cmds.extend(to_list(commands))
|
cmds.extend(to_list(commands))
|
||||||
|
|
||||||
if comment:
|
if comment:
|
||||||
cmds.append('commit and-quit comment "%s"' % kwargs.get('comment'))
|
cmds.append('commit and-quit comment "%s"' % comment)
|
||||||
else:
|
else:
|
||||||
cmds.append('commit and-quit')
|
cmds.append('commit and-quit')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue