From patchwork Fri Jan 29 06:07:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 75660 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o0T67qve002673 for ; Fri, 29 Jan 2010 06:07:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751654Ab0A2GHu (ORCPT ); Fri, 29 Jan 2010 01:07:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751592Ab0A2GHs (ORCPT ); Fri, 29 Jan 2010 01:07:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57380 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508Ab0A2GHs (ORCPT ); Fri, 29 Jan 2010 01:07:48 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0T67lje003236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Jan 2010 01:07:47 -0500 Received: from localhost.localdomain (vpn-11-140.rdu.redhat.com [10.11.11.140]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0T67YZe012118; Fri, 29 Jan 2010 01:07:45 -0500 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH 4/6] KVM test: Moving KvmLogging utility class to kvm_utils Date: Fri, 29 Jan 2010 04:07:30 -0200 Message-Id: <1264745252-14077-4-git-send-email-lmr@redhat.com> In-Reply-To: <1264745252-14077-3-git-send-email-lmr@redhat.com> References: <1264745252-14077-1-git-send-email-lmr@redhat.com> <1264745252-14077-2-git-send-email-lmr@redhat.com> <1264745252-14077-3-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 29 Jan 2010 06:07:52 +0000 (UTC) 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