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

fix: ensure keyring module is installed and available to use when querying private PPAs #20

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

philroche
Copy link
Contributor

Similar to https://github.com/canonical/ubuntu-package-status/pull/9/commits for ubuntu-package-status keyring is required when accessing private PPAs.

This fixes error when run as a snap.

Traceback (most recent call last):
  File "/snap/ubuntu-package-changelog/159/bin/ubuntu-package-changelog", line 8, in <module>
    sys.exit(main())
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/ubuntu_package_changelog/__init__.py", line 109, in main
    lp = Launchpad.login_with(
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/launchpad.py", line 700, in login_with
    return cls._authorize_token_and_login(
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/launchpad.py", line 445, in _authorize_token_and_login
    cached_credentials = credential_store.load(
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/credentials.py", line 345, in load
    return self.do_load(unique_key)
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/credentials.py", line 423, in do_load
    self._ensure_keyring_imported()
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/credentials.py", line 388, in _ensure_keyring_imported
    import keyring
ModuleNotFoundError: No module named 'keyring'

…rying private PPAs

Similar to https://github.com/canonical/ubuntu-package-status/pull/9/commits for ubuntu-package-status
`keyring` is required when accessing private PPAs.

This fixes error when run as a snap.

```
Traceback (most recent call last):
  File "/snap/ubuntu-package-changelog/159/bin/ubuntu-package-changelog", line 8, in <module>
    sys.exit(main())
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/ubuntu_package_changelog/__init__.py", line 109, in main
    lp = Launchpad.login_with(
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/launchpad.py", line 700, in login_with
    return cls._authorize_token_and_login(
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/launchpad.py", line 445, in _authorize_token_and_login
    cached_credentials = credential_store.load(
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/credentials.py", line 345, in load
    return self.do_load(unique_key)
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/credentials.py", line 423, in do_load
    self._ensure_keyring_imported()
  File "/snap/ubuntu-package-changelog/159/lib/python3.8/site-packages/launchpadlib/credentials.py", line 388, in _ensure_keyring_imported
    import keyring
ModuleNotFoundError: No module named 'keyring'

```
@toabctl toabctl self-requested a review January 17, 2024 12:57
@toabctl toabctl merged commit 5396f4e into toabctl:main Jan 17, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants