diff options
| author | Philipp Hahn <hahn@univention.de> | 2018-09-20 08:10:43 +0200 |
|---|---|---|
| committer | Michal Privoznik <mprivozn@redhat.com> | 2018-09-24 09:05:59 +0200 |
| commit | d5342a9803925ca728a33bfc5ffc6b2be0f356a6 (patch) | |
| tree | 18bbed7b1bef795f9280939dea216cb3d522bfef /examples | |
| parent | fc4000152ef8ff92d3dc99e3312f69ecb6d5bdb4 (diff) | |
| download | libvirt-python-d5342a9803925ca728a33bfc5ffc6b2be0f356a6.tar.gz | |
event-test.py: Sync list of domain lifecycle events
Add new events to prevent crash:
> Traceback (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@univention.de>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'examples')
| -rwxr-xr-x | examples/event-test.py | 8 |
1 files 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" ), |
