From 7748ebdb939c37dd627830dff2445e759ae55dd3 Mon Sep 17 00:00:00 2001 From: Jeroen van Renen Date: Wed, 17 Aug 2016 17:13:38 +0200 Subject: [PATCH] Changed 'dual_re' to 'check_commit_wait' Instead of adding a default value of 1s the 'check_commit_wait' parameter indicates a timeout is needed between check and commit and can be set between 1 and 4s. --- library/junos_install_config | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/library/junos_install_config b/library/junos_install_config index d91cbeb..4d24254 100644 --- a/library/junos_install_config +++ b/library/junos_install_config @@ -138,12 +138,12 @@ options: - Provide a confirm in minutes to the commit of the configuration required: false default: None - dual_re: + check_commit_wait: description: - - Set to yes in a Dual RE scenario when 'commit sync' is enabled in the config + - Set to number of seconds to wait between check and commit. required: false - default: no - choices: ['true','false','yes','no'] + default: "0" + choices: [1 - 4] ''' EXAMPLES = ''' @@ -308,8 +308,10 @@ def _load_via_netconf(module): if args['confirm'] is not None: opts['confirm'] = args['confirm'] - if args['dual_re']: - time.sleep(1) + if int(args['check_commit_wait']) > 0: + check_commit_wait = int(args['check_commit_wait']) + if 1 <= check_commit_wait <= 4: + time.sleep(check_commit_wait) cu.commit(**opts) @@ -413,7 +415,6 @@ def main(): comment=dict(required=False, default=None), port=dict(required=False, default=830), confirm=dict(required=False, default=None), - dual_re=dict(required=False, type='bool', choices=BOOLEANS, default=False) ), supports_check_mode=True)