bug fix: atting file count to folders

data-collector
Steve L. Nyemba 4 years ago
parent de829d7ffe
commit 7151ee4726

@ -52,7 +52,9 @@ def read(**args):
rows = util.content(rows) rows = util.content(rows)
r = dict(r, **rows) r = dict(r, **rows)
N = 0 if not os.path.exists(args['path']) else len( os.listdir(args['path']))
r['path'] = args['path'] r['path'] = args['path']
r['files']= N
r['name'] = args['path'].split(os.sep)[-1:][0] r['name'] = args['path'].split(os.sep)[-1:][0]
r['node'] = os.uname()[1] r['node'] = os.uname()[1]
r['date'] = datetime.datetime.now().strftime('%m-%d-%Y') r['date'] = datetime.datetime.now().strftime('%m-%d-%Y')

@ -96,7 +96,7 @@ def read(**args) :
tmp = df[df.name == name.strip()] tmp = df[df.name == name.strip()]
if not tmp.shape[0] : if not tmp.shape[0] :
tmp = {"pid":None,"user":None,"mem":0,"cpu":0,"status":"-100","started":None,"name":name,"cmd":None,"args":None,"date":d,"time":t,"node":n} tmp = {"pid":None,"user":None,"mem":0,"cpu":0,"status":"-100","started":None,"name":name,"cmd":None,"args":None,"date":d,"time":t,"node":n}
r = r.append(tmp) r = r.append(tmp,ignore_index=True)
df = r df = r
# #

Loading…
Cancel
Save