From ef75c5f45a087c2ae232117fff73faf47933ac0d Mon Sep 17 00:00:00 2001 From: Jay McConnell Date: Thu, 19 Feb 2015 02:08:54 +0200 Subject: [PATCH] Fix disk.usage for Synology OS relates to issue #20790 --- salt/modules/disk.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/salt/modules/disk.py b/salt/modules/disk.py index 3a11c2e412..e7a2b70c91 100644 --- a/salt/modules/disk.py +++ b/salt/modules/disk.py @@ -74,12 +74,20 @@ def usage(args=None): cmd += ' -{0}'.format(flags) ret = {} out = __salt__['cmd.run'](cmd, python_shell=False).splitlines() + oldline=None for line in out: if not line: continue if line.startswith('Filesystem'): continue + if oldline: + line = oldline + " " + line comps = line.split() + if len(comps) == 1: + oldline=line + continue + else: + oldline=None while not comps[1].isdigit(): comps[0] = '{0} {1}'.format(comps[0], comps[1]) comps.pop(1)