summary-snapshot: fix formatting of snapshot + code cleanup.

This commit is contained in:
Marcin Lulek 2019-08-26 16:58:08 +02:00
parent e9ca6badf7
commit a60f0b8b09
2 changed files with 4 additions and 3 deletions

View file

@ -90,6 +90,7 @@ def get_cert_path(ini_path):
return default
class SysInfoRes(object):
def __init__(self, value, state=None, human_value=None):
self.value = value
@ -187,7 +188,7 @@ def ulimit_info():
('open files', get_resource(resource.RLIMIT_NOFILE)),
])
text = ', '.join('{}:{}'.format(k,v) for k,v in data.items())
text = ', '.join('{}:{}'.format(k, v) for k, v in data.items())
value = {
'limits': data,

View file

@ -4,9 +4,9 @@ SYSTEM INFO
-----------
% for dt, dd, warn in c.data_items:
${'{:<60}'.format(dt.lower().replace(' ', '_'))}${': '+dd if dt else ''}
${'{:<60}'.format(dt.lower().replace(' ', '_'))}${': {}'.format(dd if dt else '')}
% if warn and warn['message']:
ALERT_${warn['type'].upper()} ${warn['message']}
${'{:<60}'.format('ALERT')} ${warn['type'].upper()} ${warn['message']}
% endif
% endfor