mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 04:25:19 +00:00
examples: Fix event detail printing in python test
If there is only one detail string for a particular event, we need to pu comma after the string otherwise the string itself will be taken as a list and only its first character will be printed out. For example, myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown F instead of the desired myDomainEventCallback1 EVENT: Domain fedora17(12) Shutdown Finished
This commit is contained in:
parent
fc4115e8d6
commit
e2a7f97b2b
@ -443,12 +443,12 @@ def eventToString(event):
|
|||||||
def detailToString(event, detail):
|
def detailToString(event, detail):
|
||||||
eventStrings = (
|
eventStrings = (
|
||||||
( "Added", "Updated" ),
|
( "Added", "Updated" ),
|
||||||
( "Removed" ),
|
( "Removed", ),
|
||||||
( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
|
( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
|
||||||
( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ),
|
( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ),
|
||||||
( "Unpaused", "Migrated", "Snapshot" ),
|
( "Unpaused", "Migrated", "Snapshot" ),
|
||||||
( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
|
( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
|
||||||
( "Finished" )
|
( "Finished", ),
|
||||||
( "Memory", )
|
( "Memory", )
|
||||||
)
|
)
|
||||||
return eventStrings[event][detail]
|
return eventStrings[event][detail]
|
||||||
|
Loading…
Reference in New Issue
Block a user