From a5a98845c76fe6616b73ce2bf07194696e970817 Mon Sep 17 00:00:00 2001 From: Jorge Schrauwen Date: Thu, 21 Jul 2016 00:28:23 +0200 Subject: [PATCH] salt.module.zpool - fix bug with properties on/off being parsed as true/false --- salt/modules/zpool.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/salt/modules/zpool.py b/salt/modules/zpool.py index 943488038e..7b41933690 100644 --- a/salt/modules/zpool.py +++ b/salt/modules/zpool.py @@ -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)