From 57117b7bde7c021ee1bf35a09d80dd23c7775d3e Mon Sep 17 00:00:00 2001 From: Joseph Hall Date: Sun, 10 Mar 2013 21:25:56 -0600 Subject: [PATCH] Add quotastats as quota.stats --- salt/modules/quota.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/salt/modules/quota.py b/salt/modules/quota.py index a4717487d8..bc8625f7dc 100644 --- a/salt/modules/quota.py +++ b/salt/modules/quota.py @@ -144,3 +144,22 @@ def warn(): ''' __salt__['cmd.run']('quotawarn') + +def stats(): + ''' + Runs the quotastats command, and returns the parsed output + + CLI Example:: + + salt '*' quota.stats + ''' + ret = {} + out = __salt__['cmd.run']('quotastats').splitlines() + for line in out: + if not line: + continue + comps = line.split(': ') + ret[comps[0]] = comps[1] + + return ret +