kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix an error of undefine variable
@ 2009-09-23  2:16 Amos Kong
  2009-09-23  2:32 ` [KVM-AUTOTEST PATCH] " Amos Kong
  0 siblings, 1 reply; 3+ messages in thread
From: Amos Kong @ 2009-09-23  2:16 UTC (permalink / raw)
  To: autotest, kvm; +Cc: lmr, Amos Kong

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 <akong@redhat.com>
---
 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__),
-- 
1.5.5.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [KVM-AUTOTEST PATCH] fix an error of undefine variable
  2009-09-23  2:16 [PATCH] fix an error of undefine variable Amos Kong
@ 2009-09-23  2:32 ` Amos Kong
  2009-10-05 17:49   ` [Autotest] " Lucas Meneghel Rodrigues
  0 siblings, 1 reply; 3+ messages in thread
From: Amos Kong @ 2009-09-23  2:32 UTC (permalink / raw)
  To: autotest, kvm; +Cc: lmr


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 <akong@redhat.com>
---
 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__),
-- 
1.5.5.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Autotest] [KVM-AUTOTEST PATCH] fix an error of undefine variable
  2009-09-23  2:32 ` [KVM-AUTOTEST PATCH] " Amos Kong
@ 2009-10-05 17:49   ` Lucas Meneghel Rodrigues
  0 siblings, 0 replies; 3+ messages in thread
From: Lucas Meneghel Rodrigues @ 2009-10-05 17:49 UTC (permalink / raw)
  To: Amos Kong; +Cc: autotest, kvm

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 <akong@redhat.com> 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|   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 <akong@redhat.com>
> ---
>  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__),
> --
> 1.5.5.6
>
> _______________________________________________
> Autotest mailing list
> Autotest@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-10-05 17:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-23  2:16 [PATCH] fix an error of undefine variable Amos Kong
2009-09-23  2:32 ` [KVM-AUTOTEST PATCH] " Amos Kong
2009-10-05 17:49   ` [Autotest] " Lucas Meneghel Rodrigues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).