Skip to content
Browse files

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
  • Loading branch information...
1 parent 280e538 commit 380737558be8d7d85e46aec4eedd6d20d138d06d @ajdecon ajdecon committed Oct 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 gpu/nvidia/python_modules/nvidia.py
View
2 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)

0 comments on commit 3807375

Please sign in to comment.
Something went wrong with that request. Please try again.