mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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.
This commit is contained in:
parent
7670572578
commit
7b8f24adda
1 changed files with 3 additions and 5 deletions
|
@ -292,11 +292,9 @@ class Zfs(object):
|
|||
if self.module.check_mode:
|
||||
self.changed = True
|
||||
return
|
||||
cmd = [self.module.get_bin_path('zfs', True)]
|
||||
cmd.append('set')
|
||||
cmd.append(prop + '=' + value)
|
||||
cmd.append(self.name)
|
||||
(rc, err, out) = self.module.run_command(' '.join(cmd))
|
||||
cmd = self.module.get_bin_path('zfs', True)
|
||||
args = [cmd, 'set', prop + '=' + value, self.name]
|
||||
(rc, err, out) = self.module.run_command(args)
|
||||
if rc == 0:
|
||||
self.changed = True
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue