Commit 7b8f24ad by Antti Rasinen

Make zfs set_property accept values with embedded spaces

Converting the argument list to a string with ' '.join causes
the shell interpreter to misparse spaces in property values.
Since the zfs command does not need shell anywhere, using
a list instead of a string works just as well with run_command. 

Fixes #3545.
parent 76705725
...@@ -292,11 +292,9 @@ class Zfs(object): ...@@ -292,11 +292,9 @@ class Zfs(object):
if self.module.check_mode: if self.module.check_mode:
self.changed = True self.changed = True
return return
cmd = [self.module.get_bin_path('zfs', True)] cmd = self.module.get_bin_path('zfs', True)
cmd.append('set') args = [cmd, 'set', prop + '=' + value, self.name]
cmd.append(prop + '=' + value) (rc, err, out) = self.module.run_command(args)
cmd.append(self.name)
(rc, err, out) = self.module.run_command(' '.join(cmd))
if rc == 0: if rc == 0:
self.changed = True self.changed = True
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment