diff options
author | Adriana Kobylak <anoo@us.ibm.com> | 2018-01-26 15:07:23 -0600 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-12 23:17:41 +0000 |
commit | 24341f9d1335a7cb175cc67557f2a8bdbb89a2e8 (patch) | |
tree | 1f275b0eabac86f9f0469e6d7af4583e6f3f685c /pyinventorymgr | |
parent | a30ab9db33bb8d1c208b2b86b8e824c5c70dae54 (diff) | |
download | talos-skeleton-24341f9d1335a7cb175cc67557f2a8bdbb89a2e8.tar.gz talos-skeleton-24341f9d1335a7cb175cc67557f2a8bdbb89a2e8.zip |
pep8 fixes
Also ignore the configs/ directory since it only contains
system configuration files named <system>.py.
Change-Id: I0416239c4030ce5bc39473e65e560016cd4ffc75
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'pyinventorymgr')
-rw-r--r-- | pyinventorymgr/inventory_items.py | 6 | ||||
-rw-r--r-- | pyinventorymgr/sync_inventory_items.py | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/pyinventorymgr/inventory_items.py b/pyinventorymgr/inventory_items.py index 254cd9e..17b5eab 100644 --- a/pyinventorymgr/inventory_items.py +++ b/pyinventorymgr/inventory_items.py @@ -40,7 +40,7 @@ class InventoryItem(DbusProperties): self.SetMultiple(INTF_NAME, data) - ## this will load properties from cache + # this will load properties from cache PropertyCacher.load(name, INTF_NAME, self.properties) @dbus.service.method( @@ -104,8 +104,8 @@ if __name__ == '__main__': obj = InventoryItem(bus, obj_path, FRUS[f]) obj_parent.add(obj_path, obj) - ## TODO: this is a hack to update bmc inventory item with version - ## should be done by flash object + # TODO: this is a hack to update bmc inventory item with version + # should be done by flash object if (FRUS[f]['fru_type'] == "BMC"): version = getVersion() obj.update({'version': version}) diff --git a/pyinventorymgr/sync_inventory_items.py b/pyinventorymgr/sync_inventory_items.py index b00ef5c..a96c015 100644 --- a/pyinventorymgr/sync_inventory_items.py +++ b/pyinventorymgr/sync_inventory_items.py @@ -71,6 +71,7 @@ def get_bmc_mac_address(bus, prop): mproxy = obj.get_dbus_method('Get', PROP_INTF_NAME) return mproxy(INV_INTF_NAME, prop) + # Get Network Interface object. def get_network_interface_object(bus): mapper = obmc.mapper.Mapper(bus) @@ -125,7 +126,7 @@ def get_sys_mac(obj): sys_mac = '' try: sys_mac = subprocess.check_output(["fw_printenv", "-n", "ethaddr"]) - except: + except Exception: # Handle when mac does not exist in u-boot return sys_mac return sys_mac @@ -159,6 +160,7 @@ def set_sys_uuid(uuid): else: print "Error setting uuid" + if __name__ == '__main__': arg = argparse.ArgumentParser() arg.add_argument('-p') |