Skip to content

Commit

Permalink
fix for pb.juniper_junos_software_member.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
chidanandpujar committed Apr 23, 2024
1 parent 32b16cd commit 9491c0e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions lib/jnpr/junos/utils/sw.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,16 @@ def reboot(
:returns:
* reboot message (string) if command successful
"""

if self._multi_VC_nsync is True or self._multi_VC is True:
vc_members = [
re.search(r"(\d+)", x).group(1)
for x in self._RE_list
if re.search(r"(\d+)", x)
]
vc_members.remove(self.dev.facts["vc_master"])
vc_members.insert(len(vc_members), self.dev.facts["vc_master"])

if self._dev.facts["_is_linux"]:
if on_node is None:
cmd = E("request-shutdown-reboot")
Expand All @@ -1220,9 +1230,16 @@ def reboot(
cmd = E("request-reboot")

try:
return self._system_operation(
cmd, in_min, at, all_re, other_re, vmhost, member_id
)
if member_id is not None:
for m_id in member_id:
if m_id in vc_members:
return self._system_operation(
cmd, in_min, at, all_re, other_re, vmhost, member_id
)
else:
return self._system_operation(
cmd, in_min, at, all_re, other_re, vmhost
)
except RpcTimeoutError as err:
raise err
except Exception as err:
Expand Down

0 comments on commit 9491c0e

Please sign in to comment.