From patchwork Wed Sep 23 02:32:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amos Kong X-Patchwork-Id: 49459 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 n8N2YNsP011036 for ; Wed, 23 Sep 2009 02:34:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753883AbZIWCeR (ORCPT ); Tue, 22 Sep 2009 22:34:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753882AbZIWCeR (ORCPT ); Tue, 22 Sep 2009 22:34:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29569 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753860AbZIWCeR (ORCPT ); Tue, 22 Sep 2009 22:34:17 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8N2YK5c010876; Tue, 22 Sep 2009 22:34:20 -0400 Received: from localhost (dhcp-65-140.nay.redhat.com [10.66.65.140]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8N2YId3008677; Tue, 22 Sep 2009 22:34:19 -0400 Date: Wed, 23 Sep 2009 10:32:45 +0800 From: Amos Kong To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: lmr@redhat.com Subject: [KVM-AUTOTEST PATCH] fix an error of undefine variable Message-ID: <20090923023245.GA15693@dhcp-66-70-48.nay.redhat.com> Reply-To: Amos Kong References: <1253672180-22742-1-git-send-email-akong@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1253672180-22742-1-git-send-email-akong@redhat.com> User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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| File "/usr/lib64/python2.4/logging/__init__.py", line 744, in emit 09/23 09:50:27 ERROR| traceback:0013| self.handleError(record) 09/23 09:50:27 ERROR| traceback:0013| File "/root/project/autotest/client/setup_modules.py", line 86, in _autotest_logging_handle_error 09/23 09:50:27 ERROR| traceback:0013| traceback.print_stack() 09/23 09:50:27 ERROR|setup_modu:0087| Future logging formatting exceptions disabled. 09/23 09:50:27 ERROR| kvm:0067| Test failed: global name 'root_module_name' is not defined Signed-off-by: Amos Kong --- client/setup_modules.py | 4 +++- 1 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): traceback.print_stack() sys.stderr.write('Future logging formatting exceptions disabled.\n') - if root_module_name == 'autotest_lib': + if global_root_module_name == 'autotest_lib': # Allow locally installed third party packages to be found # before any that are installed on the system itself when not. # running as a client. @@ -124,6 +124,8 @@ def setup(base_path, root_module_name=""): The setup must be different if you are running on an Autotest server or on a test machine that just has the client directories installed. """ + global global_root_module_name + global_root_module_name = root_module_name # Hack... Any better ideas? if (root_module_name == 'autotest_lib.client' and os.path.exists(os.path.join(os.path.dirname(__file__),