Update parser for properties on zone objects
Create a service attribute that can be optionally defined on a group
denoting what service is hosting the group members. Initially, defining
a service name generates the group member(s) to be zone objects only.
This service attribute will be enhanced to specifically note what
service provides the group members and allow for a better trigger for
properties on zone objects instead of generating a blank signal match.
Tested:
Blank signal match generated for group members in events used
Change-Id: I483fcf6a5e210e5d70bc9d5c4c0dee15524b01b9
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/gen-fan-zone-defs.py b/control/gen-fan-zone-defs.py
index e83512a..fdbdab8 100755
--- a/control/gen-fan-zone-defs.py
+++ b/control/gen-fan-zone-defs.py
@@ -130,6 +130,10 @@
member['interface'] = eGroups['interface']
member['property'] = eGroups['property']['name']
member['type'] = eGroups['property']['type']
+ # Use defined service to note member on zone object
+ if ('service' in eGroup) and \
+ (eGroup['service'] is not None):
+ member['service'] = eGroup['service']
# Add expected group member's property value if given
if ('value' in eGroups['property']) and \
(eGroups['property']['value'] is not None):
@@ -266,13 +270,16 @@
signal = {}
eMatch = next(m for m in events_data['matches']
if m['name'] == eMatches['name'])
- signal['match'] = eMatch['name']
- params = []
- if ('parameters' in eMatch) and \
- (eMatch['parameters'] is not None):
- for p in eMatch['parameters']:
- params.append(member[str(p)])
- signal['mparams'] = params
+ # If service not given, subscribe to signal match
+ if ('service' not in member):
+ signal['match'] = eMatch['name']
+ params = []
+ if ('parameters' in eMatch) and \
+ (eMatch['parameters'] is not None):
+ for p in eMatch['parameters']:
+ params.append(member[str(p)])
+ signal['mparams'] = params
+
if ('parameters' in eMatch['signal']) and \
(eMatch['signal']['parameters'] is not None):
eSignal = eMatch['signal']
@@ -418,13 +425,16 @@
signal = {}
eMatch = next(m for m in events_data['matches']
if m['name'] == eMatches['name'])
- signal['match'] = eMatch['name']
- params = []
- if ('parameters' in eMatch) and \
- (eMatch['parameters'] is not None):
- for p in eMatch['parameters']:
- params.append(member[str(p)])
- signal['mparams'] = params
+ # If service not given, subscribe to signal match
+ if ('service' not in member):
+ signal['match'] = eMatch['name']
+ params = []
+ if ('parameters' in eMatch) and \
+ (eMatch['parameters'] is not None):
+ for p in eMatch['parameters']:
+ params.append(member[str(p)])
+ signal['mparams'] = params
+
if ('parameters' in eMatch['signal']) and \
(eMatch['signal']['parameters'] is not None):
eSignal = eMatch['signal']