implement multiple parameters based on https://github.com/telmich/cdist/pull/71 by Sébastien Gross
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
f087057c98
commit
36513997d9
4 changed files with 64 additions and 7 deletions
|
|
@ -134,7 +134,11 @@ class DirectoryDict(collections.MutableMapping):
|
|||
def __setitem__(self, key, value):
|
||||
try:
|
||||
with open(os.path.join(self.path, key), "w") as fd:
|
||||
fd.write(str(value))
|
||||
if type(value) == type([]):
|
||||
for v in value:
|
||||
fd.write(str(v) + '\n')
|
||||
else:
|
||||
fd.write(str(value))
|
||||
except EnvironmentError as e:
|
||||
raise cdist.Error(str(e))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue