martin68/apt-smart

Need to accurately detect distro codename

adam-kosseck opened this issue · 0 comments

apt-smart appears to use a hard-coded list of url to determine distro codename:

  • /etc/apt/sources.list
  • /etc/apt/sources.list.d/official-package-repositories.list

apt-smart should support dynamic sources, scanning .list files under /etc/apt/sources.list.d/.

In all of the boxes in our environment, /etc/apt/sources.list is empty and we use one file per repositories in /etc/apt/sources.list.d

Running apt-smart in our environment, supplying a mirror list file results in apt-smart failing with:
2020-09-30 11:35:09 hostname.domain.com property_manager3[14498] SPAM Setting value of AptMirrorUpdater.get_sources_list_options property to {2: 'Ubuntu-Server 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)', 4: 'Ubuntu-Server 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)'} .. 2020-09-30 11:35:09 hostname.domain.com apt_smart.cli[14498] ERROR Encountered unexpected exception! Aborting .. Failed to determine the distribution codename

Would it be a better idea to just get the distro information from /etc/os-release?