From patchwork Fri Mar 19 13:19:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 86938 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 o2JDKPno018997 for ; Fri, 19 Mar 2010 13:20:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751627Ab0CSNUW (ORCPT ); Fri, 19 Mar 2010 09:20:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21765 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752143Ab0CSNUU (ORCPT ); Fri, 19 Mar 2010 09:20:20 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2JDKJkL032047 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 19 Mar 2010 09:20:19 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2JDKIUh009894; Fri, 19 Mar 2010 09:20:18 -0400 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2JDKFFw030104; Fri, 19 Mar 2010 09:20:17 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH] KVM test: kvm_config: remove -f command line option Date: Fri, 19 Mar 2010 15:19:05 +0200 Message-Id: <1269004745-5738-2-git-send-email-mgoldish@redhat.com> In-Reply-To: <1269004745-5738-1-git-send-email-mgoldish@redhat.com> References: <1269004745-5738-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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, 19 Mar 2010 13:20:25 +0000 (UTC) diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py index 0dd9278..4fc1029 100755 --- a/client/tests/kvm/kvm_config.py +++ b/client/tests/kvm/kvm_config.py @@ -675,19 +675,15 @@ def _array_get_all(a, object_cache): if __name__ == "__main__": - parser = optparse.OptionParser() - parser.add_option('-f', '--file', dest="filename", action='store', - help='path to a config file that will be parsed. ' - 'If not specified, will parse tests.cfg located ' - 'inside the kvm test dir.') + parser = optparse.OptionParser("usage: %prog [options] [filename]") parser.add_option('--verbose', dest="debug", action='store_true', help='include debug messages in console output') options, args = parser.parse_args() - filename = options.filename debug = options.debug - - if not filename: + if args: + filename = args[0] + else: filename = os.path.join(os.path.dirname(sys.argv[0]), "tests.cfg") # Here we configure the stand alone program to use the autotest @@ -695,11 +691,9 @@ if __name__ == "__main__": logging_manager.configure_logging(kvm_utils.KvmLoggingConfig(), verbose=debug) dicts = config(filename, debug=debug).get_generator() - i = 0 - for dict in dicts: + for i, dict in enumerate(dicts): logging.info("Dictionary #%d:", i) keys = dict.keys() keys.sort() for key in keys: logging.info(" %s = %s", key, dict[key]) - i += 1