Skip to content
Snippets Groups Projects
Commit ba3ca3addac4 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:ambulance: fix issue with secretstorage when docker section is not installed

parent b337d2a9a094
No related branches found
No related tags found
1 merge request!201🚑 fix issue with secretstorage when docker section is not installed
......@@ -2,6 +2,11 @@
History
=======
20.12.2
-------
Fix issue with secretstorage when docker section is not installed.
20.12.1
-------
......
......@@ -486,8 +486,7 @@
f"--index-url=https://__token__:{token}@orus.io/api/v4/groups/9/-/packages/"
f"pypi/simple"
)
else:
return "--extra-index-url=https://pypi.xcg.io/simple"
return "--extra-index-url=https://pypi.xcg.io/simple"
def base_cache_dir() -> str:
......
......@@ -4,7 +4,14 @@
from getpass import getpass
from typing import Optional
import secretstorage
# Only available if docker section is installed
try:
import secretstorage
__secretstorage_available = True
except ModuleNotFoundError:
__secretstorage_available = False
__version__ = "1.0.0"
__date__ = "2023-10-23"
......@@ -22,6 +29,8 @@
"""Retrieve Orus API token from secret service.
:return: None if there is no token"""
if not __secretstorage_available:
return None
with closing(secretstorage.dbus_init()) as conn:
collection = secretstorage.get_default_collection(conn)
for item in collection.search_items(__orus_api_token_attributes):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment