Skip to content

Commit

Permalink
Taking care of review comments and fixing the LGTM alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzailBrcm committed Nov 5, 2020
1 parent 9547b1c commit c14b93a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
37 changes: 18 additions & 19 deletions platform/pddf/i2c/utils/pddfparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,25 +971,24 @@ def show_led_device(self, key, ops):
KEY='led'
if not KEY in self.sysfs_obj:
self.sysfs_obj[KEY] = []
path="pddf/devices/led"
for attr in self.data[key]['i2c']['attr_list']:
self.sysfs_attr('device_name', self.data[key]['dev_info']['device_name'], path,
self.sysfs_obj, KEY)
self.sysfs_attr('swpld_addr', self.data[key]['dev_info']['device_name'], path,
self.sysfs_obj, KEY)
self.sysfs_attr('swpld_addr_offset', self.data[key]['dev_info']['device_name'], path,
self.sysfs_obj, KEY)
self.sysfs_device(self.data[key]['dev_attr'], path, self.sysfs_obj, KEY)
for attr_key in attr.keys():
attr_path="pddf/devices/led/" + attr['attr_name']
if (attr_key != 'attr_name' and attr_key != 'swpld_addr' and
attr_key != 'swpld_addr_offset'):
self.sysfs_attr(attr_key, attr[attr_key], attr_path, self.sysfs_obj, KEY)
sysfs_path="/sys/kernel/pddf/devices/led/dev_ops"
if not sysfs_path in self.sysfs_obj[KEY]:
self.sysfs_obj[KEY].append(sysfs_path)
list=['/sys/kernel/pddf/devices/led/cur_state/color']
self.add_list_sysfs_obj(self.sysfs_obj, KEY, list)
path="pddf/devices/led"
for attr in self.data[key]['i2c']['attr_list']:
self.sysfs_attr('device_name', self.data[key]['dev_info']['device_name'], path,
self.sysfs_obj, KEY)
self.sysfs_attr('swpld_addr', self.data[key]['dev_info']['device_name'], path,
self.sysfs_obj, KEY)
self.sysfs_attr('swpld_addr_offset', self.data[key]['dev_info']['device_name'], path,
self.sysfs_obj, KEY)
self.sysfs_device(self.data[key]['dev_attr'], path, self.sysfs_obj, KEY)
for attr_key in attr.keys():
attr_path="pddf/devices/led/" + attr['attr_name']
if (attr_key != 'attr_name' and attr_key != 'swpld_addr' and attr_key != 'swpld_addr_offset'):
self.sysfs_attr(attr_key, attr[attr_key], attr_path, self.sysfs_obj, KEY)
sysfs_path="/sys/kernel/pddf/devices/led/dev_ops"
if not sysfs_path in self.sysfs_obj[KEY]:
self.sysfs_obj[KEY].append(sysfs_path)
list=['/sys/kernel/pddf/devices/led/cur_state/color']
self.add_list_sysfs_obj(self.sysfs_obj, KEY, list)


def validate_xcvr_device(self, dev, ops):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# All the derived classes for PDDF
__all__ = ["platform", "chassis", "sfp", "psu", "thermal"]

from sonic_platform import *
# Commenting the below code as this just for the reference for the ODMs.
# It can be uncommented when this reference code is used

#from sonic_platform import *

0 comments on commit c14b93a

Please sign in to comment.