`dnf_package` resource's `flush_cache` property does not respect `:after`
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 8.2k
- Forks
- 2.5k
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 23
Description
Description
There is a documented flush_cache property that should allow avoiding use of the in-memory cache after an install/remove action is taken. It looks like the functionality was removed in aebaee14c2d6c106914d1b3e3c9c3cbdf5bc29cb, and we always flush the cache after install
Initially this could be thought to be merely a documentation bug, but there's an interesting use case for avoiding a call to the Python helper, which is when the underlying Chef Infra Client RPM has been changed, and the path to the dnf_helper.py script (in DNF_HELPER is now broken.
So there's two parts to this fix:
- Update the documentation so that the assumed default for :after is
true(ie the current behaviour). - Use
flushcache if new_resource.flush_cache[:before] == falseor something roughly similar ininstall_packageandremove_packagemethods.
Chef Version
Chef 18.5.0 (this bug goes back to Chef 12.21.3, though)
Platform Version
CentOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the dnf_package resource documentation and the install_package and remove_package methods mentioned in the issue, then inspect the linked DNF_HELPER implementation in lib/chef/provider/package/dnf/python_helper.rb. Verify the documented :before and :after behavior against the current cache handling, and consider the work complete when implementation and documentation agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, ruby
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100