From 9491c0e000ae1bacf87b3b9fe2ce6f4d7e383528 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Tue, 23 Apr 2024 16:15:50 +0530 Subject: [PATCH 1/2] fix for pb.juniper_junos_software_member.yml --- lib/jnpr/junos/utils/sw.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/jnpr/junos/utils/sw.py b/lib/jnpr/junos/utils/sw.py index 43a76c436..2a1e65ce5 100644 --- a/lib/jnpr/junos/utils/sw.py +++ b/lib/jnpr/junos/utils/sw.py @@ -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") @@ -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: From 4ae522a5fe2794f37582984f6322566560109268 Mon Sep 17 00:00:00 2001 From: chidanandpujar Date: Tue, 23 Apr 2024 16:22:42 +0530 Subject: [PATCH 2/2] fix for pb.juniper_junos_software_member.yml --- lib/jnpr/junos/utils/sw.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/jnpr/junos/utils/sw.py b/lib/jnpr/junos/utils/sw.py index 2a1e65ce5..95f7745b8 100644 --- a/lib/jnpr/junos/utils/sw.py +++ b/lib/jnpr/junos/utils/sw.py @@ -1237,9 +1237,7 @@ def reboot( 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 - ) + return self._system_operation(cmd, in_min, at, all_re, other_re, vmhost) except RpcTimeoutError as err: raise err except Exception as err: