Set python_shell=False for ebuild.py

This commit is contained in:
Colton Myers 2015-01-07 13:27:39 -07:00
parent 148643d0f8
commit eabab560b8

View File

@ -251,7 +251,9 @@ def _get_upgradable():
'''
cmd = 'emerge --pretend --update --newuse --deep --ask n world'
out = __salt__['cmd.run_stdout'](cmd, output_loglevel='trace')
out = __salt__['cmd.run_stdout'](cmd,
output_loglevel='trace',
python_shell=False)
rexp = re.compile(r'(?m)^\[.+\] '
r'([^ ]+/[^ ]+)' # Package string
@ -388,16 +390,17 @@ def refresh_db():
# We prefer 'delta-webrsync' to 'webrsync'
if salt.utils.which('emerge-delta-webrsync'):
cmd = 'emerge-delta-webrsync -q'
return __salt__['cmd.retcode'](cmd) == 0
return __salt__['cmd.retcode'](cmd, python_shell=False) == 0
else:
if __salt__['cmd.retcode']('emerge --sync --ask n --quiet') == 0:
if __salt__['cmd.retcode']('emerge --sync --ask n --quiet',
python_shell=False) == 0:
return True
# We fall back to "webrsync" if "rsync" fails for some reason
cmd = 'emerge-webrsync -q'
# We prefer 'delta-webrsync' to 'webrsync'
if salt.utils.which('emerge-delta-webrsync'):
cmd = 'emerge-delta-webrsync -q'
return __salt__['cmd.retcode'](cmd) == 0
return __salt__['cmd.retcode'](cmd, python_shell=False) == 0
def install(name=None,
@ -585,7 +588,9 @@ def install(name=None,
cmd = 'emerge --quiet --ask n {0} {1}'.format(emerge_opts, ' '.join(targets))
old = list_pkgs()
call = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
call = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
python_shell=False)
__context__.pop('pkg.list_pkgs', None)
if call['retcode'] != 0:
return _process_emerge_err(call['stdout'], call['stderr'])
@ -630,7 +635,9 @@ def update(pkg, slot=None, fromrepo=None, refresh=False):
old = list_pkgs()
cmd = 'emerge --update --newuse --oneshot --ask n --quiet {0}'.format(full_atom)
call = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
call = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
python_shell=False)
__context__.pop('pkg.list_pkgs', None)
if call['retcode'] != 0:
return _process_emerge_err(call['stdout'], call['stderr'])
@ -658,7 +665,9 @@ def upgrade(refresh=True):
old = list_pkgs()
cmd = 'emerge --update --newuse --deep --ask n --quiet world'
call = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
call = __salt__['cmd.run_all'](cmd,
output_loglevel='trace',
python_shell=False)
__context__.pop('pkg.list_pkgs', None)
if call['retcode'] != 0:
return _process_emerge_err(call['stdout'], call['stderr'])
@ -718,7 +727,9 @@ def remove(name=None, slot=None, fromrepo=None, pkgs=None, **kwargs):
return {}
cmd = 'emerge --unmerge --quiet --quiet-unmerge-warn --ask n ' \
'{0}'.format(' '.join(targets))
__salt__['cmd.run_all'](cmd, output_loglevel='trace')
__salt__['cmd.run_all'](cmd,
output_loglevel='trace',
python_shell=False)
__context__.pop('pkg.list_pkgs', None)
new = list_pkgs()
return salt.utils.compare_dicts(old, new)
@ -807,7 +818,9 @@ def depclean(name=None, slot=None, fromrepo=None, pkgs=None):
targets = [x for x in pkg_params if x in old]
cmd = 'emerge --depclean --ask n --quiet {0}'.format(' '.join(targets))
__salt__['cmd.run_all'](cmd, output_loglevel='trace')
__salt__['cmd.run_all'](cmd,
output_loglevel='trace',
python_shell=False)
__context__.pop('pkg.list_pkgs', None)
new = list_pkgs()
return salt.utils.compare_dicts(old, new)