Fix diskusage beacon

Stop trying to load the entire mount dict as the mount point.
This commit is contained in:
Morgan Willcock 2016-06-17 22:47:05 +01:00 committed by rallytime
parent 6387d1636e
commit 2e5e7ed03c

View file

@ -62,7 +62,8 @@ def beacon(config):
- /mnt/nfs: 50%
'''
ret = []
for mount in config:
for mounts in config:
mount = mounts.keys()[0]
try:
_current_usage = psutil.disk_usage(mount)
@ -72,7 +73,7 @@ def beacon(config):
continue
current_usage = _current_usage.percent
monitor_usage = config[mount]
monitor_usage = mounts[mount]
if '%' in monitor_usage:
monitor_usage = re.sub('%', '', monitor_usage)
monitor_usage = float(monitor_usage)