diff --git a/smart/top/__init__.py b/smart/top/__init__.py index 0fdb2c7..eacc3f8 100644 --- a/smart/top/__init__.py +++ b/smart/top/__init__.py @@ -115,6 +115,7 @@ def read(**args) : if 'user' in args and args['user'] : _users = ",".join([ f"'{_name.strip()}'"for _name in args['user'].split(",")]) df = df.query(f"user in ({_users})") + # # For security reasons lets has the args columns with an MD5 or sha256 # @@ -122,7 +123,8 @@ def read(**args) : # if not df.empty and 'args' in df : # df.args = [hashlib.md5(str(value).encode('utf-8')).hexdigest() for value in df.args.tolist()] STATUS = {'R':'RUNNING','Z':'DEAD','D':'STASIS','S':'SLEEP','Sl':'SLEEP','Ss':'SLEEP','W':'PAGING','T':'DEAD'} - df.status = df.status.apply(lambda value: STATUS.get(value,'UNKNOWN')) + df.loc[:, 'status'] = df.status.apply(lambda value: STATUS.get(value,'UNKNOWN')) + if 'cols' in args : _cols = list(set(df.columns.tolist()) & set(args['cols'])) if _cols :