mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
quote servermanager cmds
This commit is contained in:
parent
329c8c5723
commit
19d31a78fc
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user