Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions scripts/decode-syseeprom
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ PLATFORM_KEY = 'platform'

PLATFORM_ROOT = '/usr/share/sonic/device'

cache_root = '/var/cache/ssw/decode-syseeprom'
CACHE_ROOT = '/var/cache/sonic/decode-syseeprom'
CACHE_FILE = 'syseeprom_cache'

# Returns platform and HW SKU
def get_platform():
Expand Down Expand Up @@ -98,21 +99,21 @@ def run(target, opts, args):
sys.stderr.write("Device is not ready: " + status + "\n")
exit(0)

if not os.path.exists(cache_root):
if not os.path.exists(CACHE_ROOT):
try:
os.makedirs(cache_root)
os.makedirs(CACHE_ROOT)
except:
pass
if opts.init:
for file in glob.glob(os.path.join(cache_root, '*')):
for file in glob.glob(os.path.join(CACHE_ROOT, '*')):
os.remove(file)

#
# only the eeprom classes that inherit from eeprom_base
# support caching. Others will work normally
#
try:
target.set_cache_name(os.path.join(cache_root, opts.target))
target.set_cache_name(os.path.join(CACHE_ROOT, CACHE_FILE))
except:
pass

Expand Down