summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPhilipp Hahn <hahn@univention.de>2018-09-21 15:35:09 +0200
committerMichal Privoznik <mprivozn@redhat.com>2018-09-24 09:06:00 +0200
commitf58fcd69d2b6954265faee1c73dd42b462818aa8 (patch)
tree2c8ec8caee3b3a3da00c11bacc8b253854373013 /examples
parentdfa00dddd50c219108857678f79cf34be8f95aaf (diff)
downloadlibvirt-python-f58fcd69d2b6954265faee1c73dd42b462818aa8.tar.gz
event-test.py: Convert GRAPHICS events
to use new Description class Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/event-test.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/event-test.py b/examples/event-test.py
index b559ede..d8ba8c9 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -498,6 +498,7 @@ WATCHDOG_ACTIONS = Description("none", "Pause", "Reset", "Poweroff", "Shutdown",
ERROR_EVENTS = Description("None", "Pause", "Report")
AGENT_STATES = Description("unknown", "connected", "disconnected")
AGENT_REASONS = Description("unknown", "domain started", "channel event")
+GRAPHICS_PHASES = Description("Connect", "Initialize", "Disconnect")
def myDomainEventCallback(conn, dom, event, detail, opaque):
@@ -527,7 +528,10 @@ def myDomainEventIOErrorReasonCallback(conn, dom, srcpath, devalias, action, rea
def myDomainEventGraphicsCallback(conn, dom, phase, localAddr, remoteAddr, authScheme, subject, opaque):
- print("myDomainEventGraphicsCallback: Domain %s(%s) %d %s" % (dom.name(), dom.ID(), phase, authScheme))
+ print("myDomainEventGraphicsCallback: Domain %s(%s) %s %s" % (
+ dom.name(), dom.ID(), GRAPHICS_PHASES[phase], authScheme))
+
+
def myDomainEventControlErrorCallback(conn, dom, opaque):
print("myDomainEventControlErrorCallback: Domain %s(%s)" % (dom.name(), dom.ID()))