Skip to content

Commit

Permalink
Merge pull request #1308 from chidanandpujar/sw_member_reboot_ix1
Browse files Browse the repository at this point in the history
fix for pb.juniper_junos_software_member.yml
  • Loading branch information
dineshbaburam91 authored Apr 29, 2024
2 parents 32b16cd + 4ae522a commit 8bb2686
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 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,14 @@ 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 8bb2686

Please sign in to comment.