Skip to content

Commit

Permalink
Cleanup junos (ansible#17530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Qalthos authored Sep 12, 2016
1 parent 076a821 commit 036650c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/ansible/module_utils/junos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import re
import shlex

import re
from distutils.version import LooseVersion

from ansible.module_utils.pycompat24 import get_exception
Expand Down Expand Up @@ -175,7 +174,7 @@ def load_config(self, config, commit=False, replace=False, confirm=None,
self.lock_config()

try:
candidate = '\n'.join(candidate)
candidate = '\n'.join(config)
self.config.load(candidate, format=config_format, merge=merge,
overwrite=overwrite)

Expand Down Expand Up @@ -242,7 +241,7 @@ def rollback_config(self, identifier, commit=True, comment=None):
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:
Expand Down Expand Up @@ -271,12 +270,12 @@ def connect(self, params, **kwargs):
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')

Expand Down

0 comments on commit 036650c

Please sign in to comment.