diff --git a/lib/jnpr/junos/utils/sw.py b/lib/jnpr/junos/utils/sw.py index 71e322ef9..0231ff383 100644 --- a/lib/jnpr/junos/utils/sw.py +++ b/lib/jnpr/junos/utils/sw.py @@ -999,6 +999,8 @@ def _progress(report): 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"]) for vc_id in vc_members: if vc_id in member_id: _progress( @@ -1031,6 +1033,8 @@ def _progress(report): 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"]) for vc_id in vc_members: _progress( "installing software on VC member: {} ... please " diff --git a/tests/unit/utils/test_sw.py b/tests/unit/utils/test_sw.py index 0d658afa7..113cd02e6 100644 --- a/tests/unit/utils/test_sw.py +++ b/tests/unit/utils/test_sw.py @@ -676,6 +676,7 @@ def test_sw_install_multi_vc(self, mock_pkgadd): @patch("jnpr.junos.utils.sw.SW.pkgadd") def test_sw_install_multi_vc_member_id(self, mock_pkgadd): mock_pkgadd.return_value = True, "msg" + self.dev.facts["vc_master"] = '0' self.sw._multi_RE = True self.sw._multi_VC = True self.sw._RE_list = ("version_RE0", "version_RE1") @@ -684,6 +685,7 @@ def test_sw_install_multi_vc_member_id(self, mock_pkgadd): @patch("jnpr.junos.utils.sw.SW.pkgadd") def test_sw_install_multi_vc_multiple_member_id(self, mock_pkgadd): mock_pkgadd.return_value = True, "msg" + self.dev.facts["vc_master"] = '0' self.sw._multi_RE = False self.sw._multi_VC_nsync = True self.sw._RE_list = ("version_RE0", "version_RE1") @@ -692,6 +694,7 @@ def test_sw_install_multi_vc_multiple_member_id(self, mock_pkgadd): @patch("jnpr.junos.utils.sw.SW.pkgadd") def test_sw_install_mixed_vc(self, mock_pkgadd): mock_pkgadd.return_value = True + self.dev.facts["vc_master"] = '0' self.sw._mixed_VC = True self.sw._RE_list = ("version_RE0", "version_RE1") self.assertTrue(self.sw.install(pkg_set=["abc.tgz", "pqr.tgz"], no_copy=True))