From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: autotest@test.kernel.org
Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues <lmr@redhat.com>
Subject: [PATCH 1/5] Moving test_setup.display_attributes to kvm_utils
Date: Sun, 10 Apr 2011 14:10:19 -0300 [thread overview]
Message-ID: <1302455423-32116-1-git-send-email-lmr@redhat.com> (raw)
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
---
client/tests/kvm/kvm_utils.py | 14 ++++++++++++++
client/tests/kvm/test_setup.py | 18 +++---------------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index c3810f9..38c4afe 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -6,6 +6,7 @@ KVM test utility functions.
import time, string, random, socket, os, signal, re, logging, commands, cPickle
import fcntl, shelve, ConfigParser, rss_file_transfer, threading, sys, UserDict
+import inspect
from autotest_lib.client.bin import utils, os_dep
from autotest_lib.client.common_lib import error, logging_config
import kvm_subprocess
@@ -1199,6 +1200,19 @@ def create_report(report_dir, results_dir):
os.system('%s -r %s -f %s -R' % (reporter, results_dir, html_file))
+def display_attributes(instance):
+ """
+ Inspects a given class instance attributes and displays them, convenient
+ for debugging.
+ """
+ logging.debug("Attributes set:")
+ for member in inspect.getmembers(instance):
+ name, value = member
+ attribute = getattr(instance, name)
+ if not (name.startswith("__") or callable(attribute) or not value):
+ logging.debug(" %s: %s", name, value)
+
+
def get_full_pci_id(pci_id):
"""
Get full PCI ID of pci_id.
diff --git a/client/tests/kvm/test_setup.py b/client/tests/kvm/test_setup.py
index 1125aea..b4363e5 100644
--- a/client/tests/kvm/test_setup.py
+++ b/client/tests/kvm/test_setup.py
@@ -5,6 +5,7 @@ import os, shutil, tempfile, re, ConfigParser, glob, inspect
import logging, time
from autotest_lib.client.common_lib import error
from autotest_lib.client.bin import utils
+import kvm_utils
@error.context_aware
@@ -42,19 +43,6 @@ def clean_old_image(image):
os.remove(image)
-def display_attributes(instance):
- """
- Inspects a given class instance attributes and displays them, convenient
- for debugging.
- """
- logging.debug("Attributes set:")
- for member in inspect.getmembers(instance):
- name, value = member
- attribute = getattr(instance, name)
- if not (name.startswith("__") or callable(attribute) or not value):
- logging.debug(" %s: %s", name, value)
-
-
class Disk(object):
"""
Abstract class for Disk objects, with the common methods implemented.
@@ -490,7 +478,7 @@ class UnattendedInstallConfig(object):
Uses an appropriate strategy according to each install model.
"""
logging.info("Starting unattended install setup")
- display_attributes(self)
+ kvm_utils.display_attributes(self)
if self.unattended_file and (self.floppy or self.cdrom_unattended):
self.setup_boot_disk()
@@ -640,7 +628,7 @@ class EnospcConfig(object):
def setup(self):
logging.debug("Starting enospc setup")
error.context("performing enospc setup")
- display_attributes(self)
+ kvm_utils.display_attributes(self)
# Double check if there aren't any leftovers
self.cleanup()
try:
--
1.7.4.2
next reply other threads:[~2011-04-10 17:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-10 17:10 Lucas Meneghel Rodrigues [this message]
2011-04-10 17:10 ` [PATCH 2/5] KVM test: Moving enospc test setup to test code Lucas Meneghel Rodrigues
2011-04-10 17:10 ` [PATCH 3/5] KVM test: Moving unattended_install " Lucas Meneghel Rodrigues
2011-04-10 17:10 ` [PATCH 4/5] KVM test: Cleaning unused imports on test_setup Lucas Meneghel Rodrigues
2011-04-10 17:10 ` [PATCH 5/5] KVM test: installer: Fix bug on patch applying code 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=1302455423-32116-1-git-send-email-lmr@redhat.com \
--to=lmr@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.