mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix pacman.list_upgrades for new python_shell default.
2015.5 sets the default for python_shell to False, so the pipe used in pacman.list_upgrades no longer works. The egrep invocation after the pipe has the effect of skipping the first output line, which is an informational message. Instead of piping to egrep, we simply skip the first line of output when parsing for the available upgrades.
This commit is contained in:
parent
8917416d39
commit
dca33f1112
1 changed files with 4 additions and 5 deletions
|
@ -126,10 +126,7 @@ def list_upgrades(refresh=False):
|
|||
if refresh:
|
||||
options.append('-y')
|
||||
|
||||
cmd = (
|
||||
'pacman {0} | egrep -v '
|
||||
r'"^\s|^:"'
|
||||
).format(' '.join(options))
|
||||
cmd = ('pacman {0}').format(' '.join(options))
|
||||
|
||||
call = __salt__['cmd.run_all'](cmd, output_loglevel='trace')
|
||||
|
||||
|
@ -145,7 +142,9 @@ def list_upgrades(refresh=False):
|
|||
else:
|
||||
out = call['stdout']
|
||||
|
||||
for line in out.splitlines():
|
||||
output = iter(out.splitlines())
|
||||
output.next() # Skip informational output line
|
||||
for line in output:
|
||||
comps = line.split(' ')
|
||||
if len(comps) < 2:
|
||||
continue
|
||||
|
|
Loading…
Add table
Reference in a new issue