voxpupuli / puppet-yum

Puppet module for Yum
https://forge.puppet.com/puppet/yum
MIT License
16 stars 101 forks source link

Improve extraction of available updates #181

Closed smortex closed 4 years ago

smortex commented 4 years ago

Pull Request (PR) description

The yum list updates command outputs diagnostic messages and then the actual available updates both on stdout. Depending on the installed yum plugins, a variable number of diagnostic lines are emitted, and the output is always formatted for humans, making it non-trivial to distinguish useless and relevant lines.

Instead of ignoring the first line, match each line with a pattern matching the following fields:

These fields are separated by a variable amount of space. When a line match this pattern, consider the package as relevant for update.

This Pull Request (PR) fixes the following issues

Fixes #180

smortex commented 4 years ago

@vchepkov, can you please confirm that this fix your problem?

bastelfreak commented 4 years ago

thanks for the PR. can you add an acceptance test that verifies your changes are correct? The regex is quite hard to read :)

smortex commented 4 years ago

I could finally managed to get some time for this. I added a few unit test and rebased the fix on top of master. Thanks!