don't use empty string as command parameter

This commit is contained in:
Joseph Rawson 2015-02-09 11:28:41 -06:00
parent 97f91e5817
commit ab7346be17

View File

@ -71,7 +71,9 @@ def pvdisplay(pvname=''):
salt '*' lvm.pvdisplay /dev/md0
'''
ret = {}
cmd = ['pvdisplay', '-c', pvname]
cmd = ['pvdisplay', '-c']
if pvname:
cmd.append(pvname)
cmd_ret = __salt__['cmd.run_all'](cmd, python_shell=False)
if cmd_ret['retcode'] != 0:
@ -109,7 +111,9 @@ def vgdisplay(vgname=''):
salt '*' lvm.vgdisplay nova-volumes
'''
ret = {}
cmd = ['vgdisplay', '-c', vgname]
cmd = ['vgdisplay', '-c']
if vgname:
cmd.append(vgname)
cmd_ret = __salt__['cmd.run_all'](cmd, python_shell=False)
if cmd_ret['retcode'] != 0:
@ -152,7 +156,9 @@ def lvdisplay(lvname=''):
salt '*' lvm.lvdisplay /dev/vg_myserver/root
'''
ret = {}
cmd = ['lvdisplay', '-c', lvname]
cmd = ['lvdisplay', '-c']
if lvname:
cmd.append(lvname)
cmd_ret = __salt__['cmd.run_all'](cmd, python_shell=False)
if cmd_ret['retcode'] != 0: