diff --git a/daemon/setup.py b/daemon/setup.py index 7011ae70..af94a735 100644 --- a/daemon/setup.py +++ b/daemon/setup.py @@ -14,14 +14,14 @@ _EXAMPLES_DIR = "share/core" def recursive_files(data_path, files_path): - data_files = [] - for path, directories, filenames in os.walk(files_path): + all_files = [] + for path, _directories, filenames in os.walk(files_path): directory = os.path.join(data_path, path) files = [] for filename in filenames: files.append(os.path.join(path, filename)) - data_files.append((directory, files)) - return data_files + all_files.append((directory, files)) + return all_files def glob_files(glob_path): diff --git a/scripts/perf/perflogserver.py b/scripts/perf/perflogserver.py index 40d68891..a4c2c469 100755 --- a/scripts/perf/perflogserver.py +++ b/scripts/perf/perflogserver.py @@ -12,7 +12,6 @@ node metrics: throughput, mem, cpu total, usr, sys, wait import commands import optparse import os -import pdb import signal import sys import time @@ -116,8 +115,8 @@ def checkserverthreshold(metricval): for key in serverthresholds.getkeys(): if key == "processorusedcputime": pcpus = metricval.getvalue(key) - for ind in range(0, len(pcpus)): - if pcpus[ind] > serverthresholds.getvalue(key): + for ind, pcpu in enumerate(pcpus): + if pcpu > serverthresholds.getvalue(key): alarm = ["server", os.uname()[1], str(ind) + key, "%.2f" % pcpus[ind], ">", serverthresholds.getvalue(key)] if options.timestamp: