From patchwork Thu Aug 4 07:19:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Yang X-Patchwork-Id: 1034202 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p747JgKs002358 for ; Thu, 4 Aug 2011 07:19:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533Ab1HDHTj (ORCPT ); Thu, 4 Aug 2011 03:19:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10819 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751212Ab1HDHTj (ORCPT ); Thu, 4 Aug 2011 03:19:39 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p747JdIP013837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 4 Aug 2011 03:19:39 -0400 Received: from fyang.redhat.com (dhcp-65-138.nay.redhat.com [10.66.65.138]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p747Jagb004644; Thu, 4 Aug 2011 03:19:37 -0400 From: fyang@redhat.com To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Feng Yang Subject: [PATCH] KVM Test: Remove duplicated _close_sock function calls in kvm_monitor.py Date: Thu, 4 Aug 2011 15:19:35 +0800 Message-Id: <1312442375-6704-1-git-send-email-fyang@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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]); Thu, 04 Aug 2011 07:19:42 +0000 (UTC) From: Feng Yang self._close_sock will be called two times in HumanMonitor.__init__ and QMPMonitor.__init__ in exception. Signed-off-by: Feng Yang --- client/virt/kvm_monitor.py | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/client/virt/kvm_monitor.py b/client/virt/kvm_monitor.py index 3980da8..c96f062 100644 --- a/client/virt/kvm_monitor.py +++ b/client/virt/kvm_monitor.py @@ -174,7 +174,6 @@ class HumanMonitor(Monitor): # Find the initial (qemu) prompt s, o = self._read_up_to_qemu_prompt(20) if not s: - self._close_sock() raise MonitorProtocolError("Could not find (qemu) prompt " "after connecting to monitor. " "Output so far: %r" % o) @@ -432,7 +431,6 @@ class QMPMonitor(Monitor): try: json except NameError: - self._close_sock() raise MonitorNotSupportedError("QMP requires the json module " "(Python 2.6 and up)") @@ -447,7 +445,6 @@ class QMPMonitor(Monitor): break time.sleep(0.1) else: - self._close_sock() raise MonitorProtocolError("No QMP greeting message received") # Issue qmp_capabilities