From 894aa52dce4f92cb42de8f0b0c1c460e9fa1d87d Mon Sep 17 00:00:00 2001 From: bryan1978 Date: Thu, 24 Aug 2023 06:17:12 +0000 Subject: [PATCH 1/2] apply: Fix yang model checking failed for MGMT_PORT #2601 [storm_control] CLI show error when trying to show the configuration with the specified interface #2729 --- config/main.py | 1 + show/main.py | 1 + 2 files changed, 2 insertions(+) diff --git a/config/main.py b/config/main.py index 004b40bd..1e903735 100644 --- a/config/main.py +++ b/config/main.py @@ -4351,6 +4351,7 @@ def add(ctx, interface_name, ip_addr, gw): config_db.set_entry("MGMT_INTERFACE", (interface_name, str(ip_address)), {"NULL": "NULL"}) else: config_db.set_entry("MGMT_INTERFACE", (interface_name, str(ip_address)), {"gwaddr": gw}) + config_db.set_entry("MGMT_PORT", interface_name, {"admin_status": "up", "alias": interface_name}) return diff --git a/show/main.py b/show/main.py index b206b486..0c7956a4 100755 --- a/show/main.py +++ b/show/main.py @@ -457,6 +457,7 @@ def storm_control(ctx, namespace, display): click.echo(tabulate(body, header, tablefmt="grid")) @storm_control.command('interface') +@multi_asic_util.multi_asic_click_options @click.argument('interface', metavar='',required=True) def interface(interface, namespace, display): if multi_asic.is_multi_asic() and namespace not in multi_asic.get_namespace_list(): From 2e7b91f2488e576f06075da0eeb41842245f7667 Mon Sep 17 00:00:00 2001 From: mihirpat1 <112018033+mihirpat1@users.noreply.github.com> Date: Thu, 30 May 2024 16:32:18 -0700 Subject: [PATCH 2/2] Backup STATE_DB PORT_TABLE|Ethernet during warm-reboot (#3111) * Backup STATE_DB PORT_TABLE during warm-reboot Signed-off-by: Mihir Patel * Backing up selected fields from STATE_DB PORT_TABLE|Ethernet* and deleting unwanted fields during warm-reboot --------- Signed-off-by: Mihir Patel --- scripts/fast-reboot | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/fast-reboot b/scripts/fast-reboot index 922d217e..8163863a 100755 --- a/scripts/fast-reboot +++ b/scripts/fast-reboot @@ -247,7 +247,17 @@ function backup_database() # Delete keys in stateDB except FDB_TABLE|*, MIRROR_SESSION_TABLE|*, WARM_RESTART_ENABLE_TABLE|*, FG_ROUTE_TABLE|* sonic-db-cli STATE_DB eval " for _, k in ipairs(redis.call('keys', '*')) do - if not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \ + if string.match(k, 'PORT_TABLE|Ethernet') then + for i, f in ipairs(redis.call('hgetall', k)) do + if i % 2 == 1 then + if not string.match(f, 'host_tx_ready') \ + and not string.match(f, 'NPU_SI_SETTINGS_SYNC_STATUS') \ + and not string.match(f, 'CMIS_REINIT_REQUIRED') then + redis.call('hdel', k, f) + end + end + end + elseif not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \ and not string.match(k, 'MIRROR_SESSION_TABLE|') \ and not string.match(k, 'FG_ROUTE_TABLE|') \ and not string.match(k, 'WARM_RESTART_ENABLE_TABLE|') \