From c8b6e5fc3c8103159f29cf4fa3bbfb777e8be08e Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Thu, 1 Nov 2018 10:55:36 +0100 Subject: [PATCH] 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 --- examples/event-test.py | 4 ++-- 1 file 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):