Merge pull request #32227 from twangboy/fix_32031

Remove list2cmdline usage from win_service.py
This commit is contained in:
Mike Place 2016-03-30 08:43:17 -06:00
commit 22bd1e6b29

View file

@ -8,7 +8,6 @@ from __future__ import absolute_import
import salt.utils
import time
import logging
from subprocess import list2cmdline
from salt.ext.six.moves import zip
from salt.ext.six.moves import range
@ -97,8 +96,8 @@ def get_all():
salt '*' service.get_all
'''
ret = set()
cmd = list2cmdline(['sc', 'query', 'type=', 'service', 'state=', 'all', 'bufsize=', str(BUFFSIZE)])
lines = __salt__['cmd.run'](cmd).splitlines()
cmd = ['sc', 'query', 'type=', 'service', 'state=', 'all', 'bufsize=', str(BUFFSIZE)]
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
for line in lines:
if 'SERVICE_NAME:' in line:
comps = line.split(':', 1)
@ -335,8 +334,8 @@ def enabled(name, **kwargs):
salt '*' service.enabled <service name>
'''
cmd = list2cmdline(['sc', 'qc', name])
lines = __salt__['cmd.run'](cmd).splitlines()
cmd = ['sc', 'qc', name]
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
for line in lines:
if 'AUTO_START' in line:
return True
@ -353,8 +352,8 @@ def disabled(name):
salt '*' service.disabled <service name>
'''
cmd = list2cmdline(['sc', 'qc', name])
lines = __salt__['cmd.run'](cmd).splitlines()
cmd = ['sc', 'qc', name]
lines = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
for line in lines:
if 'DEMAND_START' in line:
return True