Skip to content

Commit 37e541c

Browse files
committed
[ycabled] add capability to enable/disable telemetry
Signed-off-by: vaibhav-dahiya <[email protected]>
1 parent cc56367 commit 37e541c

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py

+20-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
y_cable_port_instances = {}
9191
y_cable_port_locks = {}
9292

93+
disable_telemetry = False
9394

9495
Y_CABLE_STATUS_NO_TOR_ACTIVE = 0
9596
Y_CABLE_STATUS_TORA_ACTIVE = 1
@@ -1505,6 +1506,11 @@ def delete_ports_status_for_y_cable():
15051506

15061507
def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_index, logical_port_name):
15071508

1509+
global disable_telemetry
1510+
1511+
if disable_telemetry == True:
1512+
return
1513+
15081514
# Get the namespaces in the platform
15091515
config_db, port_tbl = {}, {}
15101516
namespaces = multi_asic.get_front_end_namespaces()
@@ -3537,6 +3543,8 @@ def task_worker(self):
35373543

35383544
def task_cli_worker(self):
35393545

3546+
global disable_telemetry
3547+
35403548
# Connect to STATE_DB and APPL_DB and get both the HW_MUX_STATUS_TABLE info
35413549
appl_db, config_db , state_db, y_cable_tbl = {}, {}, {}, {}
35423550
xcvrd_log_tbl = {}
@@ -3730,8 +3738,8 @@ def task_cli_worker(self):
37303738
helper_logger.log_notice("Y_CABLE_DEBUG: trying to enable/disable debug logs")
37313739
if fvp_m:
37323740

3733-
if key == "Y_CABLE":
3734-
continue
3741+
if key != "Y_CABLE":
3742+
break
37353743

37363744
fvp_dict = dict(fvp_m)
37373745
if "log_verbosity" in fvp_dict:
@@ -3743,6 +3751,16 @@ def task_cli_worker(self):
37433751

37443752
elif probe_identifier == "notice":
37453753
helper_logger.set_min_log_priority_notice()
3754+
if "disable_telemetry" in fvp_dict:
3755+
# check if xcvrd got a probe command
3756+
enable = fvp_dict["disable_telemetry"]
3757+
3758+
helper_logger.log_notice("Y_CABLE_DEBUG: trying to enable/disable telemetry flag to {}".format(enable))
3759+
if enable == "True":
3760+
disable_telemetry = True
3761+
3762+
elif enable == "False":
3763+
disable_telemetry = False
37463764

37473765
while True:
37483766
# show muxcable hwmode state <port>

0 commit comments

Comments
 (0)