[PATCH] KVM Test: Remove duplicated _close_sock function calls in kvm_monitor.py

2011-08-04 Thread fyang
From: Feng Yang fy...@redhat.com

self._close_sock will be called two times in HumanMonitor.__init__ and
QMPMonitor.__init__ in exception.

Signed-off-by: Feng Yang fy...@redhat.com
---
 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
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Autotest] [PATCH] KVM Test: Remove duplicated _close_sock function calls in kvm_monitor.py

2011-08-04 Thread Lucas Meneghel Rodrigues
On Thu, Aug 4, 2011 at 4:19 AM,  fy...@redhat.com wrote:
 From: Feng Yang fy...@redhat.com

 self._close_sock will be called two times in HumanMonitor.__init__ and
 QMPMonitor.__init__ in exception.

Looks good to me, applied, thanks!

http://autotest.kernel.org/changeset/5521

 Signed-off-by: Feng Yang fy...@redhat.com
 ---
  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
 --
 1.7.1

 ___
 Autotest mailing list
 autot...@test.kernel.org
 http://test.kernel.org/cgi-bin/mailman/listinfo/autotest




-- 
Lucas
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html