Idempotency fix for iosxr_config (#22365)

Multiple fixes to address idempotency issues, along with refactor of
module_utils iosxr to look like ios, for code consistency.

Fixes #22315
This commit is contained in:
Ricardo Carrillo Cruz 2017-03-07 16:57:19 +01:00 committed by John R Barker
parent ec9582fd83
commit fd6429fbd1
2 changed files with 17 additions and 7 deletions

View file

@ -258,10 +258,8 @@ def main():
result['commands'] = commands
if commands:
commit = not module.check_mode
response = load_config(module, commands, commit=commit)
if response.get('diff') and module._diff:
result['diff'] = {'prepared': response.get('diff')}
if not module.check_mode:
load_config(module, commands, commit=True)
result['changed'] = True
module.exit_json(**result)