From nobody Fri Mar 29 14:47:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1541066234506835.2758156333509; Thu, 1 Nov 2018 02:57:14 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E6BC8308FB8B; Thu, 1 Nov 2018 09:57:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 70F5E100034B; Thu, 1 Nov 2018 09:57:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BA141180B5B7; Thu, 1 Nov 2018 09:57:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wA19tpQ5006834 for ; Thu, 1 Nov 2018 05:55:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id 735E11054FD5; Thu, 1 Nov 2018 09:55:51 +0000 (UTC) Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 68EBC100034B; Thu, 1 Nov 2018 09:55:47 +0000 (UTC) Received: from mail.univention.de (mail.univention.de [82.198.197.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E9B9C070E19; Thu, 1 Nov 2018 09:55:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by solig.knut.univention.de (Postfix) with ESMTP id 337063CB3F9F; Thu, 1 Nov 2018 10:55:42 +0100 (CET) Received: from mail.univention.de ([127.0.0.1]) by localhost (solig.knut.univention.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7xUQ_596PARI; Thu, 1 Nov 2018 10:55:36 +0100 (CET) Received: from fixa.knut.univention.de (mail.univention.de [82.198.197.8]) by solig.knut.univention.de (Postfix) with ESMTPSA id A7A063CB3F82; Thu, 1 Nov 2018 10:55:36 +0100 (CET) Received: by fixa.knut.univention.de (Postfix, from userid 2260) id 71E341600B0; Thu, 1 Nov 2018 10:55:36 +0100 (CET) X-Virus-Scanned: by amavisd-new-2.10.1 (20141025) (Debian) at knut.univention.de From: Philipp Hahn To: libvir-list@redhat.com, Michal Privoznik Date: Thu, 1 Nov 2018 10:55:36 +0100 Message-Id: <1e0cabf1e35becec830fa6f5f382271fc7e3baf3.1541066118.git.hahn@univention.de> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Nov 2018 09:55:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 01 Nov 2018 09:55:46 +0000 (UTC) for IP:'82.198.197.8' DOMAIN:'mail.univention.de' HELO:'mail.univention.de' FROM:'hahn@univention.de' RCPT:'' X-RedHat-Spam-Score: -0.011 (RCVD_IN_DNSWL_NONE, SPF_PASS) 82.198.197.8 mail.univention.de 82.198.197.8 mail.univention.de X-Scanned-By: MIMEDefang 2.78 on 10.5.110.31 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH libvirt-python] event-test.py: Fix ERROR event X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 01 Nov 2018 09:57:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" 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 _disp= atchDomainEventIOErrorReasonCallback > reason, opaque) > File "libvirt-python/examples/event-test.py", line 536, in myDomainEven= tIOErrorReasonCallback > dom.name(), dom.ID(), srcpath, devalias, action, ERROR_EVENTS[reason]= )) > File "libvirt-python/examples/event-test.py", line 474, in __getitem__ > data =3D 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 eeb2777..dabf4b0 100755 --- a/examples/event-test.py +++ b/examples/event-test.py @@ -531,8 +531,8 @@ def myDomainEventIOErrorCallback(conn, dom, srcpath, de= valias, action, opaque): =20 =20 def myDomainEventIOErrorReasonCallback(conn, dom, srcpath, devalias, actio= n, reason, opaque): - print("myDomainEventIOErrorReasonCallback: Domain %s(%s) %s %s %d %s" = % ( - dom.name(), dom.ID(), srcpath, devalias, action, ERROR_EVENTS[reas= on])) + print("myDomainEventIOErrorReasonCallback: Domain %s(%s) %s %s %s %s" = % ( + dom.name(), dom.ID(), srcpath, devalias, ERROR_EVENTS[action], rea= son)) =20 =20 def myDomainEventGraphicsCallback(conn, dom, phase, localAddr, remoteAddr,= authScheme, subject, opaque): --=20 2.11.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list