diff --git a/library/junos_cli b/library/junos_cli index 22b46e8..df3d90f 100644 --- a/library/junos_cli +++ b/library/junos_cli @@ -68,9 +68,9 @@ options: default: 830 timeout: description: - - Extend the NETCONF RPC timeout beyond the default value of - 30 seconds. Set this value to accommodate Cli commands - that might take longer than the default timeout interval. + - Set the NETCONF RPC timeout. Set this value to accommodate Cli + commands that might take longer than the default timeout interval. + Setting to 0 will use the PyEZ default (30 seconds). required: false default: "0" logfile: @@ -127,7 +127,7 @@ def main(): user=dict(required=False, default=os.getenv('USER')), passwd=dict(required=False, default=None), port=dict(required=False, default=830), - timeout=dict(required=False, default=0), + timeout=dict(required=False, type='int', default=0), logfile=dict(required=False, default=None), dest=dict(required=False, default=None), format=dict(required=False, choices=['text', 'xml'], default='text') @@ -157,9 +157,8 @@ def main(): # --- UNREACHABLE --- ## Change default Timeout - timeout = int(m_args['timeout']) - if timeout > 0: - dev.timeout = timeout + if args['timeout'] > 0: + dev.timeout = args['timeout'] try: options = {} diff --git a/library/junos_rpc b/library/junos_rpc index 9722c04..0bcec7a 100644 --- a/library/junos_rpc +++ b/library/junos_rpc @@ -93,9 +93,9 @@ options: default: 'xml' timeout: description: - - Extend the NETCONF RPC timeout beyond the default value of - 30 seconds. Set this value to accommodate RPCs - that might take longer than the default timeout interval. + - Set the NETCONF RPC timeout. Set this value to accommodate Cli + commands that might take longer than the default timeout interval. + Setting to 0 will use the PyEZ default (30 seconds). required: false default: "0" dest: @@ -234,7 +234,7 @@ def main(): user=dict(required=False, default=os.getenv('USER')), passwd=dict(required=False, default=None), port=dict(required=False, default=830), - timeout=dict(required=False, default=0), + timeout=dict(required=False, type='int', default=0), rpc=dict(required=True, default=None), kwargs=dict(required=False, default=None), filter_xml=dict(required=False, default=None), @@ -256,9 +256,8 @@ def main(): return ## Change default Timeout - timeout = int(m_args['timeout']) - if timeout > 0: - dev.timeout = timeout + if m_args['timeout'] > 0: + dev.timeout = m_args['timeout'] results = junos_rpc(module, dev)