mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Add multiple permissions to a single export
This commit is contained in:
parent
992e8b22cc
commit
6924b1326b
@ -39,12 +39,12 @@ def list_exports(exports='/etc/exports'):
|
|||||||
if line.startswith('#'):
|
if line.startswith('#'):
|
||||||
continue
|
continue
|
||||||
comps = line.split()
|
comps = line.split()
|
||||||
ret[comps[0]] = {'hosts': [], 'options': []}
|
ret[comps[0]] = []
|
||||||
for perm in comps[1:]:
|
for perm in comps[1:]:
|
||||||
permcomps = perm.split('(')
|
permcomps = perm.split('(')
|
||||||
permcomps[1] = permcomps[1].replace(')', '')
|
permcomps[1] = permcomps[1].replace(')', '')
|
||||||
ret[comps[0]]['hosts'] = permcomps[0].split(',')
|
hosts = permcomps[0].split(',')
|
||||||
ret[comps[0]]['options'] = permcomps[1].split(',')
|
options = permcomps[1].split(',')
|
||||||
|
ret[comps[0]].append({'hosts': hosts, 'options': options})
|
||||||
f.close()
|
f.close()
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user