All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] Moving test_setup.display_attributes to kvm_utils
@ 2011-04-10 17:10 Lucas Meneghel Rodrigues
  2011-04-10 17:10 ` [PATCH 2/5] KVM test: Moving enospc test setup to test code Lucas Meneghel Rodrigues
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Lucas Meneghel Rodrigues @ 2011-04-10 17:10 UTC (permalink / raw)
  To: autotest; +Cc: kvm, Lucas Meneghel Rodrigues

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-04-10 17:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-10 17:10 [PATCH 1/5] Moving test_setup.display_attributes to kvm_utils Lucas Meneghel Rodrigues
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

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.