From 10605b2a57afa722229c7e28e4e099ded020e48b Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi Date: Mon, 1 Nov 2021 06:14:49 -0700 Subject: [PATCH 1/2] [port2alias]: Fix to get right number of return values from get_port_config. Modified to get ports from all namespaces. Signed-off-by: SuvarnaMeenakshi --- scripts/port2alias | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/port2alias b/scripts/port2alias index 6c8be6b093..3094857a69 100755 --- a/scripts/port2alias +++ b/scripts/port2alias @@ -50,7 +50,7 @@ def translate_line(line, ports): def main(): (platform, hwsku) = get_platform_hwsku() - (ports, _) = get_port_config(hwsku, platform) + (ports, _, _) = get_port_config(hwsku, platform) for line in sys.stdin: sys.stdout.write(translate_line(line, ports)) From 4cbf1c4bc38838365a99ed8750d9590222f57c2b Mon Sep 17 00:00:00 2001 From: SuvarnaMeenakshi Date: Mon, 1 Nov 2021 09:10:59 -0700 Subject: [PATCH 2/2] Modify to get ports from all namespaces. Signed-off-by: SuvarnaMeenakshi --- scripts/port2alias | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/port2alias b/scripts/port2alias index 3094857a69..0d0c007e40 100755 --- a/scripts/port2alias +++ b/scripts/port2alias @@ -50,7 +50,14 @@ def translate_line(line, ports): def main(): (platform, hwsku) = get_platform_hwsku() - (ports, _, _) = get_port_config(hwsku, platform) + ports = {} + for ns in multi_asic.get_namespace_list(): + if ns: + asic_id = multi_asic.get_asic_id_from_name(ns) + else: + asic_id = None + (ports_ns, _, _) = get_port_config(hwsku, platform, asic=asic_id) + ports.update(ports_ns) for line in sys.stdin: sys.stdout.write(translate_line(line, ports))