From: Lucas Meneghel Rodrigues Subject: Re: [Autotest] [KVM-AUTOTEST PATCH] fix an error of undefine variable Date: Mon, 5 Oct 2009 14:49:12 -0300 Message-ID: <6ac58f4f0910051049x3a8b190bnba60d7e55aa9dee5@mail.gmail.com> References: <1253672180-22742-1-git-send-email-akong@redhat.com> <20090923023245.GA15693@dhcp-66-70-48.nay.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: autotest@test.kernel.org, kvm@vger.kernel.org To: Amos Kong Return-path: Received: from mail-pz0-f177.google.com ([209.85.222.177]:39311 "EHLO mail-pz0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754111AbZJERtt convert rfc822-to-8bit (ORCPT ); Mon, 5 Oct 2009 13:49:49 -0400 Received: by pzk7 with SMTP id 7so3157254pzk.33 for ; Mon, 05 Oct 2009 10:49:12 -0700 (PDT) In-Reply-To: <20090923023245.GA15693@dhcp-66-70-48.nay.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Hi Amos, thanks for the fix! It is fine, but to avoid introducing global statements, I've worked out another patch to fix that issue. Also, there was another undefined variable lying around (base_path). I've finished up the patch and sent it to the mailing list! Cheers, On Tue, Sep 22, 2009 at 11:32 PM, Amos Kong wrote: > > Sorry for lost autotest@test.kernel.org. So send again. Thanks. > ------------------------------------------------------ > fix an error of undefine variable > > 09/23 09:50:27 ERROR| traceback:0013| =A0 File "/usr/lib64/python2.4/= logging/__init__.py", line 744, in emit > 09/23 09:50:27 ERROR| traceback:0013| =A0 =A0 self.handleError(record= ) > 09/23 09:50:27 ERROR| traceback:0013| =A0 File "/root/project/autotes= t/client/setup_modules.py", line 86, in _autotest_logging_handle_error > 09/23 09:50:27 ERROR| traceback:0013| =A0 =A0 traceback.print_stack() > 09/23 09:50:27 ERROR|setup_modu:0087| Future logging formatting excep= tions disabled. > 09/23 09:50:27 ERROR| =A0 =A0 =A0 kvm:0067| Test failed: global name = 'root_module_name' is not defined > > Signed-off-by: Amos Kong > --- > =A0client/setup_modules.py | =A0 =A04 +++- > =A01 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/client/setup_modules.py b/client/setup_modules.py > index dc255c4..8b3200b 100644 > --- a/client/setup_modules.py > +++ b/client/setup_modules.py > @@ -86,7 +86,7 @@ def _autotest_logging_handle_error(self, record): > =A0 =A0 =A0 =A0 traceback.print_stack() > =A0 =A0 =A0 =A0 sys.stderr.write('Future logging formatting exception= s disabled.\n') > > - =A0 =A0if root_module_name =3D=3D 'autotest_lib': > + =A0 =A0if global_root_module_name =3D=3D 'autotest_lib': > =A0 =A0 =A0 =A0 # Allow locally installed third party packages to be = found > =A0 =A0 =A0 =A0 # before any that are installed on the system itself = when not. > =A0 =A0 =A0 =A0 # running as a client. > @@ -124,6 +124,8 @@ def setup(base_path, root_module_name=3D""): > =A0 =A0 The setup must be different if you are running on an Autotest= server > =A0 =A0 or on a test machine that just has the client directories ins= talled. > =A0 =A0 """ > + =A0 =A0global global_root_module_name > + =A0 =A0global_root_module_name =3D root_module_name > =A0 =A0 # Hack... Any better ideas? > =A0 =A0 if (root_module_name =3D=3D 'autotest_lib.client' and > =A0 =A0 =A0 =A0 os.path.exists(os.path.join(os.path.dirname(__file__)= , > -- > 1.5.5.6 > > _______________________________________________ > Autotest mailing list > Autotest@test.kernel.org > http://test.kernel.org/cgi-bin/mailman/listinfo/autotest > --=20 Lucas