couple changes for cleanup in perflogserver.py and daemon/setup.py

This commit is contained in:
bharnden 2018-10-15 08:33:06 -07:00
parent f66efd3ab9
commit 934d7a0764
2 changed files with 6 additions and 7 deletions

View file

@ -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):

View file

@ -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: