Skip to content

Commit ee1e109

Browse files
committed
fix some delete logic
Signed-off-by: vaibhav-dahiya <[email protected]>
1 parent 73ec478 commit ee1e109

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,10 @@ def change_ports_status_for_y_cable_change_event(port_dict, y_cable_presence, st
14921492

14931493
if read_side == -1:
14941494
read_side = process_loopback_interface_and_get_read_side(loopback_keys)
1495+
if os.path.isfile(SECRETS_PATH):
1496+
with open(SECRETS_PATH, 'r') as f:
1497+
parsed_data = json.load(f)
1498+
apply_grpc_secrets_configuration(parsed_data)
14951499

14961500

14971501
# Init PORT_STATUS table if ports are on Y cable and an event is received
@@ -1553,6 +1557,7 @@ def delete_ports_status_for_y_cable():
15531557
state_db, config_db, port_tbl, y_cable_tbl = {}, {}, {}, {}
15541558
y_cable_tbl_keys = {}
15551559
static_tbl, mux_tbl = {}, {}
1560+
grpc_config = {}
15561561
namespaces = multi_asic.get_front_end_namespaces()
15571562
for namespace in namespaces:
15581563
asic_id = multi_asic.get_asic_index_from_namespace(namespace)
@@ -1566,6 +1571,14 @@ def delete_ports_status_for_y_cable():
15661571
mux_tbl[asic_id] = swsscommon.Table(
15671572
state_db[asic_id], MUX_CABLE_INFO_TABLE)
15681573
port_tbl[asic_id] = swsscommon.Table(config_db[asic_id], "MUX_CABLE")
1574+
grpc_config[asic_id] = swsscommon.Table(config_db[asic_id], "GRPCCLIENT")
1575+
1576+
1577+
if read_side != -1:
1578+
asic_index = multi_asic.get_asic_index_from_namespace(DEFAULT_NAMESPACE)
1579+
if os.path.isfile(SECRETS_PATH):
1580+
grpc_config[asic_id]._del("config")
1581+
grpc_config[asic_id]._del("certs")
15691582

15701583
# delete PORTS on Y cable table if ports on Y cable
15711584
logical_port_list = y_cable_platform_sfputil.logical

0 commit comments

Comments
 (0)