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:
Steven Armstrong 2012-06-04 22:01:32 +02:00
commit 36513997d9
4 changed files with 64 additions and 7 deletions

View file

@ -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))