From 036650cb097352a9810c6acfe2bd3354859a5149 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Mon, 12 Sep 2016 17:42:26 -0400 Subject: [PATCH] Cleanup junos (#17530) Closes #17411 --- lib/ansible/module_utils/junos.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index eefab607f2..de52a663ae 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -19,7 +19,6 @@ import re import shlex -import re from distutils.version import LooseVersion from ansible.module_utils.pycompat24 import get_exception @@ -175,7 +174,7 @@ class Netconf(object): self.lock_config() try: - candidate = '\n'.join(candidate) + candidate = '\n'.join(config) self.config.load(candidate, format=config_format, merge=merge, overwrite=overwrite) @@ -242,7 +241,7 @@ class Netconf(object): self.config.rollback(identifier) except ValueError: 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() if commit: @@ -271,12 +270,12 @@ class Cli(CliBase): self.execute('cli') self.execute('set cli screen-length 0') - def configure(self, commands, comment=None): + def configure(self, commands, comment=None, **kwargs): cmds = ['configure'] cmds.extend(to_list(commands)) if comment: - cmds.append('commit and-quit comment "%s"' % kwargs.get('comment')) + cmds.append('commit and-quit comment "%s"' % comment) else: cmds.append('commit and-quit')