quote servermanager cmds

This commit is contained in:
Justin Findlay 2015-01-10 12:29:19 -07:00
parent 329c8c5723
commit 19d31a78fc

View File

@ -4,6 +4,12 @@ Manage Windows features via the ServerManager powershell module
'''
# Import python libs
try:
from shlex import quote as _cmd_quote # pylint: disable=E0611
except ImportError:
from pipes import quote as _cmd_quote
# Import salt libs
import salt.utils
@ -96,7 +102,8 @@ def install(feature, recurse=False):
sub = ''
if recurse:
sub = '-IncludeAllSubFeature'
out = _srvmgr('Add-WindowsFeature -Name {0} {1} -erroraction silentlycontinue | format-list'.format(feature, sub))
out = _srvmgr('Add-WindowsFeature -Name {0} {1} -erroraction silentlycontinue | format-list'.format(
_cmd_quote(feature), sub))
return _parse_powershell_list(out)
@ -117,5 +124,6 @@ def remove(feature):
salt -t 600 '*' win_servermanager.remove Telnet-Client
'''
out = _srvmgr('Remove-WindowsFeature -Name {0} -erroraction silentlycontinue | format-list'.format(feature))
out = _srvmgr('Remove-WindowsFeature -Name {0} -erroraction silentlycontinue | format-list'.format(
_cmd_quote(feature)))
return _parse_powershell_list(out)