All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH skeleton] skeleton: add a new dbus method System::getFRUArea(fru_id)
@ 2016-04-15  8:00 OpenBMC Patches
  2016-04-15  8:00 ` OpenBMC Patches
  0 siblings, 1 reply; 2+ messages in thread
From: OpenBMC Patches @ 2016-04-15  8:00 UTC (permalink / raw)
  To: openbmc

This method will be used by ipmi-fru-parser to get fru area names defined
in ID_LOOKUP table. The ID_LOOKUP table defines FRUs that should be
present in the system.

Signed-off-by: Yi Li <adamliyi@msn.com>

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/openbmc/skeleton/62)
<!-- Reviewable:end -->


https://github.com/openbmc/skeleton/pull/62

Yi Li (1):
  skeleton: add a new dbus method System::getFRUArea(fru_id)

 bin/system_manager.py | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

-- 
2.7.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH skeleton] skeleton: add a new dbus method System::getFRUArea(fru_id)
  2016-04-15  8:00 [PATCH skeleton] skeleton: add a new dbus method System::getFRUArea(fru_id) OpenBMC Patches
@ 2016-04-15  8:00 ` OpenBMC Patches
  0 siblings, 0 replies; 2+ messages in thread
From: OpenBMC Patches @ 2016-04-15  8:00 UTC (permalink / raw)
  To: openbmc

From: Yi Li <adamliyi@msn.com>

This method will be used by ipmi-fru-parser to get fru area names defined
in ID_LOOKUP table. The ID_LOOKUP table defines FRUs that should be
present in the system.

Signed-off-by: Yi Li <adamliyi@msn.com>
---
 bin/system_manager.py | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/bin/system_manager.py b/bin/system_manager.py
index 004d978..05671e7 100755
--- a/bin/system_manager.py
+++ b/bin/system_manager.py
@@ -139,7 +139,23 @@ class SystemManager(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 	def getObjectFromByteId(self,category,key):
 		byte = int(key)
 		return self.doObjectLookup(category,byte)
-	
+
+	# Get the FRU area names defined in ID_LOOKUP table given a fru_id.
+	# If serval areas are defined for a fru_id, the areas are returned
+	# together as a string with each area name seperated with ','.
+	# If no fru area defined in ID_LOOKUP, an empty string will be returned.
+	@dbus.service.method(DBUS_NAME,
+		in_signature='y', out_signature='s')
+	def getFRUArea(self,fru_id):
+		ret_str = ''
+		fru_id = '_' + str(fru_id)
+		area_list = [area for area in System.ID_LOOKUP['FRU_STR'].keys() \
+				if area.endswith(fru_id)]
+		for area in area_list:
+			ret_str = area + ',' + ret_str
+		# remove the last ','
+		return ret_str[:-1]
+
 	def start_process(self,name):
 		if (System.APPS[name]['start_process'] == True):
 			app = System.APPS[name]
-- 
2.7.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-15  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-15  8:00 [PATCH skeleton] skeleton: add a new dbus method System::getFRUArea(fru_id) OpenBMC Patches
2016-04-15  8:00 ` OpenBMC Patches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.