to use new Description class
Signed-off-by: Philipp Hahn <hahn(a)univention.de>
---
examples/event-test.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/examples/event-test.py b/examples/event-test.py
index 0a1d06d..5e3b884 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -658,16 +658,16 @@ def myNodeDeviceEventUpdateCallback(conn, dev, opaque):
##########################################################################
# Secret events
##########################################################################
-def secretEventToString(event):
- secretEventStrings = ( "Defined",
- "Undefined",
- )
- return secretEventStrings[event]
+SECRET_EVENTS = Description(
+ ("Defined", ()),
+ ("Undefined", ()),
+)
+
def mySecretEventLifecycleCallback(conn, secret, event, detail, opaque):
- print("mySecretEventLifecycleCallback: Secret %s %s %d" %
(secret.UUIDString(),
-
secretEventToString(event),
- detail))
+ print("mySecretEventLifecycleCallback: Secret %s %s %s" % (
+ secret.UUIDString(), SECRET_EVENTS[event], SECRET_EVENTS[event][detail]))
+
def mySecretEventValueChanged(conn, secret, opaque):
print("mySecretEventValueChanged: Secret %s" % secret.UUIDString())
--
2.11.0