public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Goldish <mgoldish@redhat.com>
To: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: [KVM-AUTOTEST PATCH 2/5] KVM test: kvm_monitor.py: store attributes in QMPCmdError
Date: Tue, 26 Oct 2010 18:49:41 +0200	[thread overview]
Message-ID: <1288111784-10188-2-git-send-email-mgoldish@redhat.com> (raw)
In-Reply-To: <1288111784-10188-1-git-send-email-mgoldish@redhat.com>

For consistency with the exceptions in kvm_subprocess.

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_monitor.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/client/tests/kvm/kvm_monitor.py b/client/tests/kvm/kvm_monitor.py
index e0365cd..7f5ddf8 100644
--- a/client/tests/kvm/kvm_monitor.py
+++ b/client/tests/kvm/kvm_monitor.py
@@ -38,9 +38,15 @@ class MonitorNotSupportedError(MonitorError):
 
 
 class QMPCmdError(MonitorError):
+    def __init__(self, cmd, qmp_args, data):
+        MonitorError.__init__(self, cmd, qmp_args, data)
+        self.cmd = cmd
+        self.qmp_args = qmp_args
+        self.data = data
+
     def __str__(self):
-        return ("QMP command '%s' failed (arguments: %r, error message: %r)" %
-                tuple(self.args))
+        return ("QMP command %r failed (arguments: %r, error message: %r)" %
+                (self.cmd, self.qmp_args, self.data))
 
 
 class Monitor:
-- 
1.5.5.6

  reply	other threads:[~2010-10-26 16:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-26 16:49 [KVM-AUTOTEST PATCH 1/5] KVM test: kvm_subprocess: raise exceptions in kvm_shell_session and kvm_expect Michael Goldish
2010-10-26 16:49 ` Michael Goldish [this message]
2010-10-26 16:49   ` [KVM-AUTOTEST PATCH 3/5] KVM test: add utility functions start_windows_service() and stop_windows_service() Michael Goldish
2010-10-26 16:49     ` [KVM-AUTOTEST PATCH 4/5] KVM test: kvm_subprocess: rename get_command_status_output() and friends Michael Goldish
2010-10-26 16:49       ` [KVM-AUTOTEST PATCH 5/5] [RFC] KVM test: kvm_subprocess: rename kvm_shell_session " Michael Goldish
2010-10-27 21:07         ` Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288111784-10188-2-git-send-email-mgoldish@redhat.com \
    --to=mgoldish@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox