1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-17 00:59:36 +03:00

event-test.py: Convert CONNECTION events

to use new Description class

Signed-off-by: Philipp Hahn <hahn@univention.de>
This commit is contained in:
Philipp Hahn
2018-09-21 15:35:16 +02:00
committed by Michal Privoznik
parent bf7c6135e8
commit 10ba71a0a0

View File

@ -677,15 +677,16 @@ def mySecretEventValueChanged(conn, secret, opaque):
##########################################################################
run = True
CONNECTION_EVENTS = Description("Error", "End-of-file", "Keepalive", "Client")
def myConnectionCloseCallback(conn, reason, opaque):
reasonStrings = (
"Error", "End-of-file", "Keepalive", "Client",
)
print("myConnectionCloseCallback: %s: %s" % (conn.getURI(), reasonStrings[reason]))
print("myConnectionCloseCallback: %s: %s" % (
conn.getURI(), CONNECTION_EVENTS[reason]))
global run
run = False
def usage():
print("usage: %s [-hdl] [uri]" % (os.path.basename(__file__),))
print(" uri will default to qemu:///system")