File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ class ChangeApplier:
71
71
72
72
def __init__ (self ):
73
73
self .config_db = get_config_db ()
74
+ self .backend_tables = [
75
+ "BUFFER_PG" ,
76
+ "BUFFER_PROFILE" ,
77
+ "FLEX_COUNTER_TABLE"
78
+ ]
74
79
if (not ChangeApplier .updater_conf ) and os .path .exists (UPDATER_CONF_FILE ):
75
80
with open (UPDATER_CONF_FILE , "r" ) as s :
76
81
ChangeApplier .updater_conf = json .load (s )
@@ -142,6 +147,8 @@ def apply(self, change):
142
147
ret = self ._services_validate (run_data , upd_data , upd_keys )
143
148
if not ret :
144
149
run_data = self ._get_running_config ()
150
+ upd_data = self .get_config_without_backend_tables (upd_data )
151
+ run_data = self .get_config_without_backend_tables (run_data )
145
152
if upd_data != run_data :
146
153
self ._report_mismatch (run_data , upd_data )
147
154
ret = - 1
@@ -150,6 +157,13 @@ def apply(self, change):
150
157
return ret
151
158
152
159
160
+ def get_config_without_backend_tables (self , data ):
161
+ cropped_data = {
162
+ k : v for k , v in data .items () if k not in self .backend_tables
163
+ }
164
+ return cropped_data
165
+
166
+
153
167
def _get_running_config (self ):
154
168
(_ , fname ) = tempfile .mkstemp (suffix = "_changeApplier" )
155
169
os .system ("sonic-cfggen -d --print-data > {}" .format (fname ))
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ def apply(self, patch):
77
77
# Validate config updated successfully
78
78
self .logger .log_notice ("Verifying patch updates are reflected on ConfigDB." )
79
79
new_config = self .config_wrapper .get_config_db_as_json ()
80
+ target_config = self .changeapplier .get_config_without_backend_tables (target_config )
81
+ new_config = self .changeapplier .get_config_without_backend_tables (new_config )
80
82
if not (self .patch_wrapper .verify_same_json (target_config , new_config )):
81
83
raise GenericConfigUpdaterError (f"After applying patch to config, there are still some parts not updated" )
82
84
You can’t perform that action at this time.
0 commit comments