From 3a2cfadb3195286d46d7572b33b8b1aa1815df8a Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Tue, 20 Sep 2016 11:42:51 -0400 Subject: [PATCH] fixes junos_config to be idempotent when confirming a commit (#4946) The junos_config module would always return true when confirming a commit This changes the module to now check first making the feature idempontent --- network/junos/junos_config.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/network/junos/junos_config.py b/network/junos/junos_config.py index 017b2b1c36c..d7458d956c7 100644 --- a/network/junos/junos_config.py +++ b/network/junos/junos_config.py @@ -228,9 +228,8 @@ def zeroize_config(module, result): result['changed'] = True def confirm_config(module, result): - if not module.check_mode: - module.connection.commit_config() - result['changed'] = True + checkonly = module.check_mode + result['changed'] = module.connection.confirm_commit(checkonly) def run(module, result): if module.params['rollback']: