puppetlabs / puppetlabs-package

A Puppet Task module, for package.
Apache License 2.0
9 stars 25 forks source link

Remove unwanted lines from yum output #316

Closed ememilyly closed 7 months ago

ememilyly commented 1 year ago

Summary

Package status pulls yum security information as the latest version when package is up to date and server isn't running latest installed kernel.

Additional Context

See https://github.com/puppetlabs/puppetlabs-package/issues/314 for context

grep yum output for the package name specifically to strip any extraneous lines, similarly to https://github.com/puppetlabs/puppetlabs-package/blob/main/files/zypper.sh#LL5C89-L5C96

Related Issues (if any)

https://github.com/puppetlabs/puppetlabs-package/issues/314

Checklist

Manually verified as below Before:

bolt > bolt task run package action=status name=rpm -t server0001
Started on server0001...
Finished on server0001:
  {
    "status": "installed",
    "version": "4.14.3-26.el8",
    "latest": "kernel-core-4.18.0-477.13.1.el8_8.x86_64"
  }
Successful on 1 target: server0001
Ran on 1 target in 7.8 sec

After:

dev-bolt > bolt task run package action=status name=rpm -t server0001
Started on server0001...
Finished on server0001:
  {
    "status": "installed",
    "version": "4.14.3-26.el8"
  }
Successful on 1 target: server0001
Ran on 1 target in 8.35 sec
CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

ememilyly commented 1 year ago

Changed to just grep for the package name as that's infinitely more straight forward 🙂