From d48074bc3576b4408df8808e895c293e82a8c914 Mon Sep 17 00:00:00 2001 From: Vivek Reddy Date: Thu, 29 Aug 2024 17:12:20 -0700 Subject: [PATCH] Upgrade pyroute2 and improve cli response time --- setup.py | 2 +- utilities_common/multi_asic.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6a66f012f9..8bf87e7584 100644 --- a/setup.py +++ b/setup.py @@ -249,7 +249,7 @@ 'pexpect>=4.8.0', 'semantic-version>=2.8.5', 'prettyprinter>=0.18.0', - 'pyroute2>=0.5.14, <0.6.1', + 'pyroute2==0.7.12', 'requests>=2.25.0, <=2.31.0', 'tabulate==0.9.0', 'toposort==1.6', diff --git a/utilities_common/multi_asic.py b/utilities_common/multi_asic.py index b1f24e12e8..4ebd728031 100644 --- a/utilities_common/multi_asic.py +++ b/utilities_common/multi_asic.py @@ -3,7 +3,6 @@ import click import netifaces -import pyroute2 from natsort import natsorted from sonic_py_common import multi_asic, device_info from utilities_common import constants @@ -170,6 +169,7 @@ def multi_asic_args(parser=None): return parser def multi_asic_get_ip_intf_from_ns(namespace): + import pyroute2 if namespace != constants.DEFAULT_NAMESPACE: pyroute2.netns.pushns(namespace) interfaces = natsorted(netifaces.interfaces()) @@ -181,6 +181,7 @@ def multi_asic_get_ip_intf_from_ns(namespace): def multi_asic_get_ip_intf_addr_from_ns(namespace, iface): + import pyroute2 if namespace != constants.DEFAULT_NAMESPACE: pyroute2.netns.pushns(namespace) ipaddresses = netifaces.ifaddresses(iface)