Generate InterfacesRemoved signal events
In the case that an interface containing a property used within an event
is removed from dbus, that event can subscribe to the InterfacesRemoved
signal. When an InterfacesRemoved signal is received by fan control, the
corresponding interface (and all associated properties) is removed from
the cache used by all events.
*Note: This area of signal subscription/handling code generation is
intended to be re-worked under openbmc/openbmc#2911. This is the reason
for supporting a different yaml layout for the InterfacesRemoved signal.
Tested:
Generated code constructs InterfacesRemoved signals correctly
Resolves openbmc/openbmc#2223
Change-Id: Idc3e8db4e7dc07a2bb6898d3cc30ab775362dd35
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 b89e5bc..43d98bc 100755
--- a/control/gen-fan-zone-defs.py
+++ b/control/gen-fan-zone-defs.py
@@ -414,8 +414,12 @@
for p in eMatch['parameters']:
params.append(member[str(p)])
signal['mparams'] = params
- eSignal = next(s for s in events_data['signals']
- if s['name'] == eMatch['signal'])
+ if ('parameters' in eMatch['signal']) and \
+ (eMatch['signal']['parameters'] is not None):
+ eSignal = eMatch['signal']
+ else:
+ eSignal = next(s for s in events_data['signals']
+ if s['name'] == eMatch['signal'])
signal['signal'] = eSignal['name']
sparams = {}
if ('parameters' in eSignal) and \
@@ -562,8 +566,12 @@
for p in eMatch['parameters']:
params.append(member[str(p)])
signal['mparams'] = params
- eSignal = next(s for s in events_data['signals']
- if s['name'] == eMatch['signal'])
+ if ('parameters' in eMatch['signal']) and \
+ (eMatch['signal']['parameters'] is not None):
+ eSignal = eMatch['signal']
+ else:
+ eSignal = next(s for s in events_data['signals']
+ if s['name'] == eMatch['signal'])
signal['signal'] = eSignal['name']
sparams = {}
if ('parameters' in eSignal) and \