diff options
| author | Philipp Hahn <hahn@univention.de> | 2018-11-01 10:55:36 +0100 |
|---|---|---|
| committer | Michal Privoznik <mprivozn@redhat.com> | 2018-11-01 14:09:20 +0100 |
| commit | c8b6e5fc3c8103159f29cf4fa3bbfb777e8be08e (patch) | |
| tree | 8025c88857f103dc9be8ca3a3ab3593c32e25132 /examples | |
| parent | b1828e604f92c426301cd63b174292c9fda88182 (diff) | |
| download | libvirt-python-c8b6e5fc3c8103159f29cf4fa3bbfb777e8be08e.tar.gz | |
event-test.py: Fix ERROR event
ERROR_EVENTS translates the numeric 'action' argument to a description,
not the 'reason' argument which already contains a descriptive string
like 'enospc'.
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/libvirt.py", line 4661, in _dispatchDomainEventIOErrorReasonCallback
> reason, opaque)
> File "libvirt-python/examples/event-test.py", line 536, in myDomainEventIOErrorReasonCallback
> dom.name(), dom.ID(), srcpath, devalias, action, ERROR_EVENTS[reason]))
> File "libvirt-python/examples/event-test.py", line 474, in __getitem__
> data = self.args[item]
> TypeError: tuple indices must be integers, not str
Fixes: f5928c6711654f1496707ca77f626b3192843d57
Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'examples')
| -rwxr-xr-x | examples/event-test.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/event-test.py b/examples/event-test.py index 540bf9b..5e1ee9e 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -539,8 +539,8 @@ def myDomainEventIOErrorCallback(conn, dom, srcpath, devalias, action, opaque): def myDomainEventIOErrorReasonCallback(conn, dom, srcpath, devalias, action, reason, opaque): - print("myDomainEventIOErrorReasonCallback: Domain %s(%s) %s %s %d %s" % ( - dom.name(), dom.ID(), srcpath, devalias, action, ERROR_EVENTS[reason])) + print("myDomainEventIOErrorReasonCallback: Domain %s(%s) %s %s %s %s" % ( + dom.name(), dom.ID(), srcpath, devalias, ERROR_EVENTS[action], reason)) def myDomainEventGraphicsCallback(conn, dom, phase, localAddr, remoteAddr, authScheme, subject, opaque): |
