Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distribution_codename() seems broken on Ubuntu 22.04 #19

Open
nergdron opened this issue May 16, 2022 · 0 comments
Open

distribution_codename() seems broken on Ubuntu 22.04 #19

nergdron opened this issue May 16, 2022 · 0 comments

Comments

@nergdron
Copy link

nergdron commented May 16, 2022

attempting to test apt-smart on the latest Ubuntu LTS, and it fails in the most basic use case, can't seem to detect the release name from /etc/apt/sources.list, even though it's the default config:

# docker run -it ubuntu:22.04
root@31c59159a087:/# apt update && apt install -y python3-pip
[ apt installing ]
root@31c59159a087:/# pip install apt-smart
[ pip installing ]
root@31c59159a087:/# apt-smart -a
2022-05-16 16:45:57 31c59159a087 apt_smart[4205] INFO Changing mirror of local system (31c59159a087) to best available mirror ..
2022-05-16 16:45:57 31c59159a087 apt_smart.cli[4205] ERROR Encountered unexpected exception! Aborting ..
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/apt_smart/cli.py", line 211, in main
    callback()
  File "/usr/local/lib/python3.10/dist-packages/apt_smart/__init__.py", line 589, in change_mirror
    new_mirror = self.best_mirror
  File "/usr/local/lib/python3.10/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
  File "/usr/local/lib/python3.10/dist-packages/apt_smart/__init__.py", line 203, in best_mirror
    logger.debug("Selecting best %s mirror ..", self.distributor_id.capitalize())
  File "/usr/local/lib/python3.10/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
  File "/usr/local/lib/python3.10/dist-packages/apt_smart/__init__.py", line 313, in distributor_id
    return self.release.distributor_id
  File "/usr/local/lib/python3.10/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
  File "/usr/local/lib/python3.10/dist-packages/apt_smart/__init__.py", line 447, in release
    return coerce_release(self.distribution_codename)
  File "/usr/local/lib/python3.10/dist-packages/property_manager3/__init__.py", line 784, in __get__
    value = super(custom_property, self).__get__(obj, type)
  File "/usr/local/lib/python3.10/dist-packages/apt_smart/__init__.py", line 298, in distribution_codename
    raise EnvironmentError("Failed to determine the distribution codename using apt's package resource list!")
OSError: Failed to determine the distribution codename using apt's package resource list!

note that this could probably be fixed by resolving issue #10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant