mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 03:41:25 -07:00
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
This commit is contained in:
parent
01e27b1083
commit
597bca3129
4 changed files with 37 additions and 16 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue