]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
examples: Fix event detail printing in python test
authorJiri Denemark <jdenemar@redhat.com>
Thu, 6 Sep 2012 15:02:47 +0000 (17:02 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 7 Sep 2012 07:38:22 +0000 (09:38 +0200)
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

examples/domain-events/events-python/event-test.py

index fd71acd21775905c84ab083fd96987e228ff26b2..3e314bff3bfc24f2d8a965d0c08eac16875f951d 100644 (file)
@@ -443,12 +443,12 @@ def eventToString(event):
 def detailToString(event, detail):
     eventStrings = (
         ( "Added", "Updated" ),
-        ( "Removed" ),
+        ( "Removed", ),
         ( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
         ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot" ),
         ( "Unpaused", "Migrated", "Snapshot" ),
         ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
-        ( "Finished" )
+        ( "Finished", ),
         ( "Memory", )
         )
     return eventStrings[event][detail]