From 380737558be8d7d85e46aec4eedd6d20d138d06d Mon Sep 17 00:00:00 2001 From: Adam DeConinck Date: Tue, 2 Oct 2012 16:35:03 -0700 Subject: [PATCH] Change "||" to "or" to avoid syntax error The "logical OR" operator in Python is "or", not "||". Before this change, when gmond runs in debug level 2, the following message is printed: loaded module: multicpu_module [PYTHON] Can't import the metric module [nvidia]. File "/usr/lib64/ganglia/python_modules/nvidia.py", line 102 elif (metric == 'perf_state' || metric == 'performance_state'): ^ SyntaxError: invalid syntax --- gpu/nvidia/python_modules/nvidia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpu/nvidia/python_modules/nvidia.py b/gpu/nvidia/python_modules/nvidia.py index c8ae6bec..84957bb4 100644 --- a/gpu/nvidia/python_modules/nvidia.py +++ b/gpu/nvidia/python_modules/nvidia.py @@ -99,7 +99,7 @@ def gpu_device_handler(name): except NVMLError, nvmlError: if NVML_ERROR_NOT_SUPPORTED == nvmlError.value: return 'N/A' - elif (metric == 'perf_state' || metric == 'performance_state'): + elif (metric == 'perf_state' or metric == 'performance_state'): state = nvmlDeviceGetPerformanceState(gpu_device) try: int(state)