@@ -27,6 +27,8 @@ def __init__(self, path, format, start, status, readonly):
2727 self .s = start
2828 self .u = status
2929 self .r = readonly
30+ # Warning: the following members are deprecated, the parsed EEPROM data is stored in the
31+ # Redis STATE_DB, cached data should be fetched from STATE_DB.EEPROM_INFO.
3032 self .cache_name = None
3133 self .cache_update_needed = False
3234 self .lock_file = None
@@ -47,6 +49,9 @@ def check_status(self):
4749 return 'ok'
4850
4951 def set_cache_name (self , name ):
52+ # Warning: this method is deprecated, the parsed EEPROM data is stored in the
53+ # Redis STATE_DB, cached data should be fetched from STATE_DB.EEPROM_INFO.
54+
5055 # before accessing the eeprom we acquire an exclusive lock on the eeprom file.
5156 # this will prevent a race condition where multiple instances of this app
5257 # could try to update the cache at the same time
@@ -214,6 +219,9 @@ def open_eeprom(self):
214219 using_eeprom = True
215220 eeprom_file = self .p
216221 try :
222+ # Warning: cache file is deprecated, the parsed EEPROM data is stored in the
223+ # Redis STATE_DB, cached data should be fetched from STATE_DB.EEPROM_INFO. This
224+ # code need to be adjusted once cache file is completely removing from the system.
217225 if os .path .isfile (self .cache_name ):
218226 eeprom_file = self .cache_name
219227 using_eeprom = False
@@ -240,6 +248,9 @@ def read_eeprom_bytes(self, byteCount, offset=0):
240248 # expect, the file may be corrupt. Delete it and try again, this
241249 # time reading from the actual EEPROM.
242250 if len (o ) != byteCount and not self .cache_update_needed :
251+ # Warning: cache file is deprecated, the parsed EEPROM data is stored in the
252+ # Redis STATE_DB, cached data should be fetched from STATE_DB.EEPROM_INFO. This
253+ # code needs to be adjusted once cache file is completely removed from the system.
243254 os .remove (self .cache_name )
244255 self .cache_update_needed = True
245256 F .close ()
@@ -277,6 +288,9 @@ def write_eeprom(self, e):
277288 self .write_cache (e )
278289
279290 def write_cache (self , e ):
291+ # Warning: this method is deprecated, the parsed EEPROM data is stored in the
292+ # Redis STATE_DB, cached data should be fetched from STATE_DB.EEPROM_INFO.
293+
280294 if self .cache_name :
281295 F = None
282296 try :
@@ -290,6 +304,9 @@ def write_cache(self, e):
290304 F .close ()
291305
292306 def update_cache (self , e ):
307+ # Warning: this method is deprecated, the parsed EEPROM data is stored in the
308+ # Redis STATE_DB, cached data should be fetched from STATE_DB.EEPROM_INFO.
309+
293310 if self .cache_update_needed :
294311 self .write_cache (e )
295312 fcntl .flock (self .lock_file , fcntl .LOCK_UN )
0 commit comments