diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-12-17 12:03:40 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-12-17 12:03:40 -0500 |
commit | f85cdd702dc50d72bc85be7980b6b1e85d2d3719 (patch) | |
tree | 41f4baa75eebec97caaa9227a0bc3d625c7fc02d /func/minion/modules/mount.py | |
parent | 169e4f8e7466e0144d05489a8a53a54180e654f9 (diff) | |
download | third_party-func-f85cdd702dc50d72bc85be7980b6b1e85d2d3719.tar.gz third_party-func-f85cdd702dc50d72bc85be7980b6b1e85d2d3719.tar.xz third_party-func-f85cdd702dc50d72bc85be7980b6b1e85d2d3719.zip |
Working on adding mount status to func-inventory
Diffstat (limited to 'func/minion/modules/mount.py')
-rw-r--r-- | func/minion/modules/mount.py | 18 |
1 files changed, 18 insertions, 0 deletions
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 |