mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
salt.module.zpool - fix bug with properties on/off being parsed as true/false
This commit is contained in:
parent
dd64494a19
commit
a5a98845c7
1 changed files with 6 additions and 3 deletions
|
@ -671,10 +671,13 @@ def create(zpool, *vdevs, **kwargs):
|
|||
if properties: # create "-o property=value" pairs
|
||||
optlist = []
|
||||
for prop in properties:
|
||||
if ' ' in properties[prop]:
|
||||
value = "'{0}'".format(properties[prop])
|
||||
if isinstance(properties[prop], bool):
|
||||
value = 'on' if properties[prop] else 'off'
|
||||
else:
|
||||
value = properties[prop]
|
||||
if ' ' in properties[prop]:
|
||||
value = "'{0}'".format(properties[prop])
|
||||
else:
|
||||
value = properties[prop]
|
||||
optlist.append('-o {0}={1}'.format(prop, value))
|
||||
opts = ' '.join(optlist)
|
||||
cmd = '{0} {1}'.format(cmd, opts)
|
||||
|
|
Loading…
Add table
Reference in a new issue