epiphany
epiphany copied to clipboard
[Ubuntu] Simplify APT commands flow in download-requirements.py
Is your feature request related to a problem? Please describe. Current flow for a package is:
-
apt-cache show
-
apt-cache policy
-
apt-cache depends
-
apt download
It looks like apt-cache policy
may be replaced by apt-cache show
, which seems to return the candidate version at the top, for example:
apt-cache policy filebeat | grep Candidate
Candidate: 7.17.5
vs
apt-cache show filebeat | grep Version | head -1
Version: 7.17.5
Describe the solution you'd like
Refactor get_package_info
method in ansible/playbooks/roles/repository/files/download-requirements/src/command/debian/apt_cache.py
to not use __get_package_candidate_version
. The latter probably can be removed.
Describe alternatives you've considered Keep current flow if necessary.
Additional context n/a
DoD checklist
- Changelog
- [ ] updated
- [ ] not needed
- COMPONENTS.md
- [ ] updated
- [ ] not needed
- Schema
- [ ] updated
- [ ] not needed
- Backport tasks
- [ ] created
- [ ] not needed
- Documentation
- [ ] added
- [ ] updated
- [ ] not needed
- [ ] Feature has automated tests
- [ ] Automated tests passed (QA pipelines)
- [ ] apply
- [ ] upgrade
- [ ] backup/restore
- [ ] Idempotency tested
- [ ] All conversations in PR resolved
- [ ] Solution meets requirements and is done according to design doc
- [ ] Usage compliant with license