From f85cdd702dc50d72bc85be7980b6b1e85d2d3719 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 17 Dec 2007 12:03:40 -0500 Subject: Working on adding mount status to func-inventory --- func/minion/modules/mount.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'func') diff --git a/func/minion/modules/mount.py b/func/minion/modules/mount.py index bbaf7c7..e0cbe75 100644 --- a/func/minion/modules/mount.py +++ b/func/minion/modules/mount.py @@ -80,5 +80,23 @@ class MountModule(func_module.FuncModule): else: return False + def inventory(): + cmd = sub_process.Popen(["/bin/mount"], stdout=sub_process.PIPE, shell=False) + output = cmd.communicate()[0] + lines = output.split("\n") + results = [] + for line in lines: + if line.find(" on ") == -1: + continue + (resource,rest) = line.split(" on ") + (mountpoint,mtype) = rest.split(" type ") + (realtype, params) = mtype.split(None) + params = params.replace("(","") + params = params.replace(")","") + paramlist = params.split(",") + results.append([resource,mountpoint,realtype,paramlist]) + return results + + methods = MountModule() register_rpc = methods.register_rpc -- cgit