Merge pull request #135 from jbain/timeout

Fix typo in timeout in junos_cli, simplified default timeout handling
This commit is contained in:
Damien 2016-05-06 18:23:26 -07:00
Родитель 6735038164 d309f3e1d2
Коммит 05c4f2e8d8
2 изменённых файлов: 12 добавлений и 14 удалений

Просмотреть файл

@ -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 = {}

Просмотреть файл

@ -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)