Skip to content

Commit

Permalink
Merge pull request #521 from rahkumar651991/in_min_issue
Browse files Browse the repository at this point in the history
default value is modified in variable in_min
  • Loading branch information
Nitin Kr authored Aug 25, 2020
2 parents 7ff4e07 + 1978852 commit 989c66e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions library/juniper_junos_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
value of C(zeroize). The I(in_min) option is mutually exclusive with
the I(at) option.
required: false
default: none
default: 0
type: int
all_re:
description:
Expand Down Expand Up @@ -273,7 +273,7 @@ def main():
in_min=dict(type='int',
required=False,
aliases=['in'],
default=None),
default=0),
all_re=dict(type='bool',
required=False,
default=True),
Expand Down Expand Up @@ -313,7 +313,7 @@ def main():
#Four actions are expected - reboot, shutdown, halt and zeroize
if action not in ['reboot', 'shutdown', 'halt']:
# at, in_min and other_re option only applies to reboot, shutdown, or halt action.
for arg_type,arg_val in {"at":at,"in_min":in_min,"other_re":other_re}:
for arg_type, arg_val in {"at": at, "in_min": in_min, "other_re": other_re}:
if arg_val is not None:
junos_module.fail_json(msg='The %s option can only be used when '
'the action option has the value "reboot", '
Expand Down Expand Up @@ -341,8 +341,7 @@ def main():
# </rpc-reply> and therefore might get an RpcTimeout.
# (This is a known Junos bug.) Set the timeout low so this happens
# relatively quickly.
if (at == 'now' or in_min == 0 or
(at is None and in_min is None)):
if at == 'now' or (in_min == 0 and at is None):
if junos_module.dev.timeout > 5:
junos_module.logger.debug("Decreasing device RPC timeout "
"to 5 seconds.")
Expand Down

0 comments on commit 989c66e

Please sign in to comment.