From 4f65e00c31ea011576a2b5203ff41e131e9a2c03 Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Wed, 3 Mar 2021 13:33:47 +0000 Subject: [PATCH 1/7] Added support for dynamic interface attachment detection --- acos_client/v30/action.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/acos_client/v30/action.py b/acos_client/v30/action.py index 0c122e028..4980474b6 100644 --- a/acos_client/v30/action.py +++ b/acos_client/v30/action.py @@ -119,3 +119,11 @@ def get_vcs_summary_oper(self): def get_thunder_up_time(self): url = "/miscellenious-alb/oper" return self._get(url) + + def probe_network_devices(self): + url = "/system/probe-network-devices" + self._post(url) + + def get_acos_version(self): + url = "/version/oper" + return self._get(url) From ba24047795d3f1d2bf557986524b2d3bc28db830 Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Thu, 4 Mar 2021 10:04:50 +0000 Subject: [PATCH 2/7] Modified tox to fix travis issues --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 6d2467e2a..9e989c129 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = python setup.py test -q {posargs} +uhashring==1.2 [testenv:pep8] basepython = python3.6 From 2e8ed15368a8a503dc4fe35004904bef74c2facd Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Thu, 4 Mar 2021 10:21:40 +0000 Subject: [PATCH 3/7] Fixed travis issue --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 9e989c129..ee06b7187 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,8 @@ install_command = pip install -U {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt + uhashring==1.2 commands = python setup.py test -q {posargs} -uhashring==1.2 [testenv:pep8] basepython = python3.6 From 879c46bedcfe573515a62b2077972cf2a3e304e9 Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Thu, 4 Mar 2021 10:27:08 +0000 Subject: [PATCH 4/7] reverted tox changes and modified requirements --- requirements.txt | 2 +- tox.ini | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index d7be1a216..3a7c54abd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ requests>=2.3.0 six -uhashring +uhashring==1.2 ipaddress==1.0.22; python_version < '3.0' diff --git a/tox.ini b/tox.ini index ee06b7187..6d2467e2a 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,6 @@ install_command = pip install -U {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt - uhashring==1.2 commands = python setup.py test -q {posargs} [testenv:pep8] From 9096e760368315174897da76b757b3bb785ca865 Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Mon, 8 Mar 2021 07:22:45 +0000 Subject: [PATCH 5/7] Incorporated review comment to add reload_reboot method --- acos_client/v30/action.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/acos_client/v30/action.py b/acos_client/v30/action.py index 4980474b6..1163dd516 100644 --- a/acos_client/v30/action.py +++ b/acos_client/v30/action.py @@ -127,3 +127,18 @@ def probe_network_devices(self): def get_acos_version(self): url = "/version/oper" return self._get(url) + + def reload_reboot(self, acos_version=None): + if not acos_version: + version_summary = self.get_acos_version() + acos_version = version_summary['version']['oper']['sw-version'].split(',')[0] + + major = acos_version.split('.')[0] + minor = acos_version.split('.')[1] + patch = acos_version.split('.')[2] + + if major >= 5 and minor >= 2 and patch >= 0: + self.probe_network_devices() + self.reload() + else: + self.reboot() From fa8c04c419a1a4be2b37d4bba9c0e5f216e7d940 Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Tue, 9 Mar 2021 07:01:11 +0000 Subject: [PATCH 6/7] Modified API name from reload_reboot to reload_reboot_for_interface_attachment --- acos_client/v30/action.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acos_client/v30/action.py b/acos_client/v30/action.py index 1163dd516..bb017f8b4 100644 --- a/acos_client/v30/action.py +++ b/acos_client/v30/action.py @@ -128,7 +128,7 @@ def get_acos_version(self): url = "/version/oper" return self._get(url) - def reload_reboot(self, acos_version=None): + def reload_reboot_for_interface_attachment(self, acos_version=None): if not acos_version: version_summary = self.get_acos_version() acos_version = version_summary['version']['oper']['sw-version'].split(',')[0] From 7066a752af6a587282eb9447884520b80d03e8c8 Mon Sep 17 00:00:00 2001 From: NehaKembalkarA10 Date: Fri, 12 Mar 2021 15:34:19 +0000 Subject: [PATCH 7/7] Added API for performing reload/reboot for interface detachment --- acos_client/v30/action.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/acos_client/v30/action.py b/acos_client/v30/action.py index bb017f8b4..71a3848f3 100644 --- a/acos_client/v30/action.py +++ b/acos_client/v30/action.py @@ -142,3 +142,18 @@ def reload_reboot_for_interface_attachment(self, acos_version=None): self.reload() else: self.reboot() + + def reload_reboot_for_interface_detachment(self, acos_version=None): + if not acos_version: + version_summary = self.get_acos_version() + acos_version = version_summary['version']['oper']['sw-version'].split(',')[0] + + major = acos_version.split('.')[0] + minor = acos_version.split('.')[1] + patch = acos_version.split('.')[2] + + if major >= 5 and minor >= 2 and patch >= 1: + self.probe_network_devices() + self.reload() + else: + self.reboot()