From eae1193c75faed94ceacbf1d69f0422eaa873a1e Mon Sep 17 00:00:00 2001 From: Andriy Yurkiv <70649192+ayurkiv-nvda@users.noreply.github.com> Date: Wed, 9 Jun 2021 13:39:22 +0300 Subject: [PATCH] Set default values only on the first start (#7735) --- dockers/docker-orchagent/enable_counters.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dockers/docker-orchagent/enable_counters.py b/dockers/docker-orchagent/enable_counters.py index 5455f5923571..a00bd3facce7 100755 --- a/dockers/docker-orchagent/enable_counters.py +++ b/dockers/docker-orchagent/enable_counters.py @@ -11,10 +11,12 @@ def enable_counter_group(db, name): - info = {} - info['FLEX_COUNTER_STATUS'] = 'enable' - db.mod_entry("FLEX_COUNTER_TABLE", name, info) + entry_info = db.get_entry("FLEX_COUNTER_TABLE", name) + if not entry_info: + info = {} + info['FLEX_COUNTER_STATUS'] = 'enable' + db.mod_entry("FLEX_COUNTER_TABLE", name, info) def enable_rates(): # set the default interval for rates