hitachienergy / epiphany

Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Apache License 2.0
138 stars 107 forks source link

[Ubuntu] Simplify APT commands flow in download-requirements.py #3241

Closed to-bar closed 2 years ago

to-bar commented 2 years ago

Is your feature request related to a problem? Please describe. Current flow for a package is:

  1. apt-cache show
  2. apt-cache policy
  3. apt-cache depends
  4. 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