[PATCH libvirt-python 1/2] event-test.py: Sync list of domain lifecycle events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add new events to prevent crash:
> raceback (most recent call last):
>   File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4601, in _dispatchDomainEventCallbacks
>     cb(self, virDomain(self, _obj=dom), event, detail, opaque)
>   File "libvirt-python/examples/event-test.py", line 505, in myDomainEventCallback1
>     domDetailToString(event, detail)))
>   File "libvirt-python/examples/event-test.py", line 484, in domDetailToString
>     return domEventStrings[event][detail]
> IndexError: tuple index out of range

Signed-off-by: Philipp Hahn <hahn@xxxxxxxxxxxxx>
---
 examples/event-test.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/examples/event-test.py b/examples/event-test.py
index 281e661..04310e1 100755
--- a/examples/event-test.py
+++ b/examples/event-test.py
@@ -471,11 +471,11 @@ def domEventToString(event):
 
 def domDetailToString(event, detail):
     domEventStrings = (
-        ( "Added", "Updated" ),
-        ( "Removed", ),
+        ( "Added", "Updated", "Renamed", "Snapshot" ),
+        ( "Removed", "Renamed", ),
         ( "Booted", "Migrated", "Restored", "Snapshot", "Wakeup" ),
-        ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot", "API error" ),
-        ( "Unpaused", "Migrated", "Snapshot" ),
+        ( "Paused", "Migrated", "IOError", "Watchdog", "Restored", "Snapshot", "API error", "Postcopy", "Postcopy failed" ),
+        ( "Unpaused", "Migrated", "Snapshot", "Postcopy" ),
         ( "Shutdown", "Destroyed", "Crashed", "Migrated", "Saved", "Failed", "Snapshot"),
         ( "Finished", "On guest request", "On host request"),
         ( "Memory", "Disk" ),
-- 
2.11.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux