summaryrefslogtreecommitdiffstats
path: root/pyinventorymgr
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2016-08-03 11:03:45 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2016-08-08 10:47:35 -0500
commit9baab4eb2d575618b6efc23f015140ea9ac85983 (patch)
tree06a8bdb7f7811fcc54f11b9efbda761c7ff8884b /pyinventorymgr
parent987170ede11a4751f931bf531a8e5599315029a7 (diff)
downloadtalos-skeleton-9baab4eb2d575618b6efc23f015140ea9ac85983.tar.gz
talos-skeleton-9baab4eb2d575618b6efc23f015140ea9ac85983.zip
Load inventory from cache
The inventory is persisted across BMC reboots, so load this data at BMC startup to not need a system power off/on to load the inventory. Load the cached values after setting the property values to default, so that the cached value (if any) overwrites the default value and the properties return to the same state they were prior to BMC reboot. Fixes openbmc/openbmc#487 Change-Id: I9e40b2af6880dbaa4ccc0f7e93c74ecf63a51d6f Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
Diffstat (limited to 'pyinventorymgr')
-rw-r--r--pyinventorymgr/inventory_items.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pyinventorymgr/inventory_items.py b/pyinventorymgr/inventory_items.py
index 8261589..dc692b2 100644
--- a/pyinventorymgr/inventory_items.py
+++ b/pyinventorymgr/inventory_items.py
@@ -29,8 +29,7 @@ class InventoryItem(DbusProperties):
dbus.service.Object.__init__(self,bus,name)
self.name = name
-
- ## this will load properties from cache
+
if (data.has_key('present') == False):
data['present'] = 'False'
if (data.has_key('fault') == False):
@@ -39,6 +38,9 @@ class InventoryItem(DbusProperties):
data['version'] = ''
self.SetMultiple(INTF_NAME,data)
+
+ ## this will load properties from cache
+ PropertyCacher.load(name, INTF_NAME, self.properties)
@dbus.service.method(INTF_NAME,
OpenPOWER on IntegriCloud