diff options
author | Nathaniel Case <this.is@nathanielca.se> | 2017-04-04 15:00:00 -0400 |
---|---|---|
committer | Nathaniel Case <ncase@redhat.com> | 2017-04-04 15:01:36 -0400 |
commit | bf805d145324dc5692ff26aecd931474bfbb4e65 (patch) | |
tree | 7afc4b424f41c01ccdcd7cfb992ad2c3d66472b1 /lib/ansible/module_utils/junos.py | |
parent | ec0cbfac4be6a3865a3ff66431ea68f37e72b9f3 (diff) | |
download | ansible-bf805d145324dc5692ff26aecd931474bfbb4e65.tar.gz |
junos_config: Remove reliance on ability to output configuration in `set` format (#23225)
* Remove reliance on ability to output configuration in `set` format
* Support multiple warnings per rpc-reply
Diffstat (limited to 'lib/ansible/module_utils/junos.py')
-rw-r--r-- | lib/ansible/module_utils/junos.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index dfe3148157..211e099eb6 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -147,7 +147,7 @@ def get_diff(module): if output is not None: return output.text -def load_config(module, candidate, action='merge', commit=False, format='xml', +def load_config(module, candidate, warnings, action='merge', commit=False, format='xml', comment=None, confirm=False, confirm_timeout=None): with locked_config(module): @@ -155,6 +155,8 @@ def load_config(module, candidate, action='merge', commit=False, format='xml', candidate = '\n'.join(candidate) reply = load_configuration(module, candidate, action=action, format=format) + if isinstance(reply, list): + warnings.extend(reply) validate(module) diff = get_diff(module) @@ -168,4 +170,3 @@ def load_config(module, candidate, action='merge', commit=False, format='xml', discard_changes(module) return diff - |