mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix pacman.list_upgrades when refresh=True.
When refresh=True, there more than 1 informational line. Only use lines that match the specified print format, which has one space (all other lines have more than one space).
This commit is contained in:
parent
7914f51636
commit
7062ae4eae
1 changed files with 2 additions and 4 deletions
|
@ -142,11 +142,9 @@ def list_upgrades(refresh=False):
|
|||
else:
|
||||
out = call['stdout']
|
||||
|
||||
output = iter(out.splitlines())
|
||||
output.next() # Skip informational output line
|
||||
for line in output:
|
||||
for line in iter(out.splitlines()):
|
||||
comps = line.split(' ')
|
||||
if len(comps) < 2:
|
||||
if len(comps) != 2:
|
||||
continue
|
||||
upgrades[comps[0]] = comps[1]
|
||||
return upgrades
|
||||
|
|
Loading…
Add table
Reference in a new issue