Skip to content

Commit

Permalink
yum-cron: don't fail on empty transaction. BZ 1004853
Browse files Browse the repository at this point in the history
Even if refreshUpdates() returns True, the transaction may still be
empty if some updateinfo filters were applied there and thus a later
call to buildTransaction() would return 0 (success).  This wasn't
handled by findDeps() properly, making it emit an error message in such
a case.

Note that, in the first place, we shouldn't return True from
refreshUpdates() if the transaction becomes empty after applying the
filters.  However, we should handle this particular buildTransaction()
outcome in findDeps() regardless and that's sufficient to fix this bug.

See also:
http:https://lists.baseurl.org/pipermail/yum/2014-December/024141.html
  • Loading branch information
andreasf authored and dmnks committed Mar 16, 2016
1 parent 22af2b2 commit ae22bcd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion yum-cron/yum-cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,13 @@ def findDeps(self):
except yum.Errors.RepoError, e:
self.emitCheckFailed("%s" %(e,))
sys.exit()
if res != 2:
if res == 0:
# success, empty transaction
sys.exit(0)
elif res == 2:
# success, dependencies resolved
pass
else:
self.emitCheckFailed("Failed to build transaction: %s" %(str.join("\n", resmsg),))
sys.exit(1)

Expand Down

0 comments on commit ae22bcd

Please sign in to comment.