mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-07-28 15:41:52 +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:
committed by
Michal Privoznik
parent
bf7c6135e8
commit
10ba71a0a0
@ -677,15 +677,16 @@ def mySecretEventValueChanged(conn, secret, opaque):
|
|||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
run = True
|
run = True
|
||||||
|
CONNECTION_EVENTS = Description("Error", "End-of-file", "Keepalive", "Client")
|
||||||
|
|
||||||
|
|
||||||
def myConnectionCloseCallback(conn, reason, opaque):
|
def myConnectionCloseCallback(conn, reason, opaque):
|
||||||
reasonStrings = (
|
print("myConnectionCloseCallback: %s: %s" % (
|
||||||
"Error", "End-of-file", "Keepalive", "Client",
|
conn.getURI(), CONNECTION_EVENTS[reason]))
|
||||||
)
|
|
||||||
print("myConnectionCloseCallback: %s: %s" % (conn.getURI(), reasonStrings[reason]))
|
|
||||||
global run
|
global run
|
||||||
run = False
|
run = False
|
||||||
|
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print("usage: %s [-hdl] [uri]" % (os.path.basename(__file__),))
|
print("usage: %s [-hdl] [uri]" % (os.path.basename(__file__),))
|
||||||
print(" uri will default to qemu:///system")
|
print(" uri will default to qemu:///system")
|
||||||
|
Reference in New Issue
Block a user