Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for pb.juniper_junos_software_member.yml #1308

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading