sdbus++: events: fix Redfish registry type for enums
Fix two issues with the Redfish registry generation:
1. Enums should be strings (and not numbers) in the MessageArgs.
2. Enums have a complex type which requires do a "type_tuple"
processing before attempting to look up the Registry type.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ieda935f553dd73a22eedbe9ab87f0950554b95a2
diff --git a/tools/sdbusplus/property.py b/tools/sdbusplus/property.py
index c1b24bb..7d52b2f 100644
--- a/tools/sdbusplus/property.py
+++ b/tools/sdbusplus/property.py
@@ -257,14 +257,14 @@
"enum": {
"cppName": "enum",
"params": 1,
- "registryName": "number",
+ "registryName": "string",
},
}
""" Get the registry type of the property. """
def registry_type(self):
- return Property.propertyMap[self.typeName]["registryName"]
+ return Property.propertyMap[self.__type_tuple()[0]]["registryName"]
""" Take a list of dbus types and perform validity checking, such as:
[ variant [ dict [ int32, int32 ], double ] ]