Skip to content

Commit

Permalink
fix load board class of eeprom module issue (#2666)
Browse files Browse the repository at this point in the history
  • Loading branch information
keboliu authored and liat-grozovik committed Mar 18, 2019
1 parent 62e994d commit cfbc817
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/sonic-daemon-base/sonic_daemon_base/daemon_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
HWSKU_KEY = 'DEVICE_METADATA.localhost.hwsku'
PLATFORM_KEY = 'DEVICE_METADATA.localhost.platform'

EEPROM_MODULE_NAME = 'eeprom'
EEPROM_CLASS_NAME = 'board'

class DaemonBase(object):
# Redis DB information
redis_hostname = "localhost"
Expand Down Expand Up @@ -127,7 +130,11 @@ def load_platform_util(self, module_name, class_name):

try:
platform_util_class = getattr(module, class_name)
platform_util = platform_util_class()
# board class of eeprom requires 4 paramerters, need special treatment here.
if module_name == EEPROM_MODULE_NAME and class_name == EEPROM_CLASS_NAME:
platform_util = platform_util_class('','','','')
else:
platform_util = platform_util_class()
except AttributeError, e:
self.log_error("Failed to instantiate '%s' class: %s" % (class_name, str(e)))
return None
Expand Down

0 comments on commit cfbc817

Please sign in to comment.