diff mbox

[4/6] KVM test: Moving KvmLogging utility class to kvm_utils

Message ID 1264745252-14077-4-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Jan. 29, 2010, 6:07 a.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/cd_hash.py b/client/tests/kvm/cd_hash.py
index 483d71c..a857ed8 100755
--- a/client/tests/kvm/cd_hash.py
+++ b/client/tests/kvm/cd_hash.py
@@ -10,11 +10,6 @@  import common, kvm_utils
 from autotest_lib.client.common_lib import logging_config, logging_manager
 
 
-class KvmLoggingConfig(logging_config.LoggingConfig):
-    def configure_logging(self, results_dir=None, verbose=False):
-        super(KvmLoggingConfig, self).configure_logging(use_console=True,
-                                                        verbose=verbose)
-
 if __name__ == "__main__":
     parser = optparse.OptionParser()
     parser.add_option('-i', '--iso', type="string", dest="filename",
@@ -25,7 +20,7 @@  if __name__ == "__main__":
     options, args = parser.parse_args()
     filename = options.filename
 
-    logging_manager.configure_logging(KvmLoggingConfig())
+    logging_manager.configure_logging(kvm_utils.KvmLoggingConfig())
 
     if not filename:
         parser.print_help()
diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py
index 798ef56..51f069a 100755
--- a/client/tests/kvm/kvm_config.py
+++ b/client/tests/kvm/kvm_config.py
@@ -11,12 +11,6 @@  from autotest_lib.client.common_lib import error
 from autotest_lib.client.common_lib import logging_config, logging_manager
 
 
-class KvmLoggingConfig(logging_config.LoggingConfig):
-    def configure_logging(self, results_dir=None, verbose=False):
-        super(KvmLoggingConfig, self).configure_logging(use_console=True,
-                                                        verbose=verbose)
-
-
 class config:
     """
     Parse an input file or string that follows the KVM Test Config File format
@@ -517,7 +511,7 @@  if __name__ == "__main__":
 
     # Here we configure the stand alone program to use the autotest
     # logging system.
-    logging_manager.configure_logging(KvmLoggingConfig(), verbose=debug)
+    logging_manager.configure_logging(kvm_utils.KvmLoggingConfig(), verbose=debug)
     list = config(filename, debug=debug).get_list()
     i = 0
     for dict in list:
diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index f8089f7..5452026 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -970,6 +970,16 @@  def get_vendor_from_pci_id(pci_id):
     return re.sub(":", " ", commands.getoutput(cmd))
 
 
+class KvmLoggingConfig(logging_config.LoggingConfig):
+    """
+    Used with the sole purpose of providing convenient logging setup
+    for the KVM test auxiliary programs.
+    """
+    def configure_logging(self, results_dir=None, verbose=False):
+        super(KvmLoggingConfig, self).configure_logging(use_console=True,
+                                                        verbose=verbose)
+
+
 class PciAssignable(object):
     """
     Request PCI assignable devices on host. It will check whether to request