From patchwork Mon Jun 8 04:01:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 28543 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n5842Cq8007564 for ; Mon, 8 Jun 2009 04:02:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750725AbZFHECE (ORCPT ); Mon, 8 Jun 2009 00:02:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750757AbZFHECD (ORCPT ); Mon, 8 Jun 2009 00:02:03 -0400 Received: from mx2.redhat.com ([66.187.237.31]:59274 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750719AbZFHECB (ORCPT ); Mon, 8 Jun 2009 00:02:01 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n58424kJ027341 for ; Mon, 8 Jun 2009 00:02:04 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n58423Et009399; Mon, 8 Jun 2009 00:02:03 -0400 Received: from localhost.localdomain (vpn-10-45.bos.redhat.com [10.16.10.45]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n5841xtX011888; Mon, 8 Jun 2009 00:02:02 -0400 From: Lucas Meneghel Rodrigues To: kvm@vger.kernel.org Cc: Lucas Meneghel Rodrigues Subject: [PATCH 1/3] Make possible to use kvm_config as a standalone program. Date: Mon, 8 Jun 2009 01:01:47 -0300 Message-Id: <1244433717-3391-3-git-send-email-lmr@redhat.com> In-Reply-To: <1244433717-3391-2-git-send-email-lmr@redhat.com> References: <1244433717-3391-1-git-send-email-lmr@redhat.com> <1244433717-3391-2-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Replace autotest exceptions for standard python exceptions. This will allow kvm_config.py to be used as a stand alone program. Signed-off-by: Lucas Meneghel Rodrigues --- client/tests/kvm/kvm_config.py | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/client/tests/kvm/kvm_config.py b/client/tests/kvm/kvm_config.py index 8b6ab15..dda421b 100755 --- a/client/tests/kvm/kvm_config.py +++ b/client/tests/kvm/kvm_config.py @@ -1,5 +1,4 @@ import re, os, sys, StringIO -from autotest_lib.client.common_lib import error """ KVM configuration file utility functions. @@ -356,7 +355,7 @@ class config: # (inside an exception or inside subvariants) if restricted: e_msg = "Using variants in this context is not allowed" - raise error.AutotestError() + raise ValueError(e_msg) if self.debug and not restricted: self.__debug_print(indented_line, "Entering variants block (%d dicts in" @@ -401,7 +400,7 @@ class config: words[1]) if not os.path.exists(filename): e_msg = "Cannot include %s -- file not found" % filename - raise error.AutotestError(e_msg) + raise IOError(e_msg) new_file = open(filename, "r") list = self.parse(new_file, list, restricted) new_file.close() @@ -409,7 +408,7 @@ class config: self.__debug_print("", "Leaving file %s" % words[1]) else: e_msg = "Cannot include anything because no file is open" - raise error.AutotestError(e_msg) + raise ValueError(e_msg) # Parse multi-line exceptions # (the block is parsed for each dict separately)