[PATCH skeleton] Load inventory from cache

OpenBMC Patches openbmc-patches at stwcx.xyz
Thu Aug 4 12:01:09 AEST 2016


From: Adriana Kobylak <anoo at us.ibm.com>

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.
Fixes openbmc/openbmc#487

Change-Id: I67099508edcdbc0077b3cbc5fd47fcacfbace5af
Signed-off-by: Adriana Kobylak <anoo at us.ibm.com>
---
 pyinventorymgr/inventory_items.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pyinventorymgr/inventory_items.py b/pyinventorymgr/inventory_items.py
index 772fb3e..4b8169c 100644
--- a/pyinventorymgr/inventory_items.py
+++ b/pyinventorymgr/inventory_items.py
@@ -31,7 +31,6 @@ class InventoryItem(DbusProperties):
 
 		self.name = name
 		
-		## this will load properties from cache
 		if (data.has_key('present') == False):
 			data['present'] = 'False'
 		if (data.has_key('fault') == False):
@@ -40,7 +39,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,
 		in_signature='a{sv}', out_signature='')
-- 
2.9.0




More information about the openbmc mailing list