From patchwork Tue Jan 11 13:13:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 471561 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0BDEHT2008472 for ; Tue, 11 Jan 2011 13:14:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932157Ab1AKNNe (ORCPT ); Tue, 11 Jan 2011 08:13:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7065 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932149Ab1AKNNc (ORCPT ); Tue, 11 Jan 2011 08:13:32 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0BDDVRf009610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Jan 2011 08:13:31 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0BDDVJa022723; Tue, 11 Jan 2011 08:13:31 -0500 Received: from qu0061.eng.lab.tlv.redhat.com ([10.35.16.61]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p0BDD9nb025030; Tue, 11 Jan 2011 08:13:30 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 15/26] KVM test: kvm_monitor.py: don't unpack socket.error args Date: Tue, 11 Jan 2011 15:13:27 +0200 Message-Id: <1294751618-21631-15-git-send-email-mgoldish@redhat.com> In-Reply-To: <1294751618-21631-1-git-send-email-mgoldish@redhat.com> References: <1294751618-21631-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 11 Jan 2011 13:14:19 +0000 (UTC) diff --git a/client/tests/kvm/kvm_monitor.py b/client/tests/kvm/kvm_monitor.py index 5d3422e..48d627f 100644 --- a/client/tests/kvm/kvm_monitor.py +++ b/client/tests/kvm/kvm_monitor.py @@ -119,9 +119,9 @@ class Monitor: while self._data_available(): try: data = self._socket.recv(1024) - except socket.error, (errno, msg): + except socket.error, e: raise MonitorSocketError("Could not receive data from monitor " - "(%s)" % msg) + "(%s)" % e) if not data: break s += data @@ -212,9 +212,9 @@ class HumanMonitor(Monitor): try: try: self._socket.sendall(cmd + "\n") - except socket.error, (errno, msg): - raise MonitorSocketError("Could not send monitor command '%s' " - "(%s)" % (cmd, msg)) + except socket.error, e: + raise MonitorSocketError("Could not send monitor command %r " + "(%s)" % (cmd, e)) finally: self._lock.release() @@ -484,9 +484,9 @@ class QMPMonitor(Monitor): """ try: self._socket.sendall(data) - except socket.error, (errno, msg): + except socket.error, e: raise MonitorSocketError("Could not send data: %r (%s)" % - (data, msg)) + (data, e)) def _get_response(self, id=None, timeout=20):