diff --git a/NEWS.rst b/NEWS.rst index b337d2a9a094a7b6700e86025db19f289a33ff11_TkVXUy5yc3Q=..ba3ca3addac43f5162c2af8521dbbca630fc9731_TkVXUy5yc3Q= 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -2,6 +2,11 @@ History ======= +20.12.2 +------- + +Fix issue with secretstorage when docker section is not installed. + 20.12.1 ------- diff --git a/odoo_scripts/docker_build_copy.py b/odoo_scripts/docker_build_copy.py index b337d2a9a094a7b6700e86025db19f289a33ff11_b2Rvb19zY3JpcHRzL2RvY2tlcl9idWlsZF9jb3B5LnB5..ba3ca3addac43f5162c2af8521dbbca630fc9731_b2Rvb19zY3JpcHRzL2RvY2tlcl9idWlsZF9jb3B5LnB5 100644 --- a/odoo_scripts/docker_build_copy.py +++ b/odoo_scripts/docker_build_copy.py @@ -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: diff --git a/odoo_scripts/storage.py b/odoo_scripts/storage.py index b337d2a9a094a7b6700e86025db19f289a33ff11_b2Rvb19zY3JpcHRzL3N0b3JhZ2UucHk=..ba3ca3addac43f5162c2af8521dbbca630fc9731_b2Rvb19zY3JpcHRzL3N0b3JhZ2UucHk= 100644 --- a/odoo_scripts/storage.py +++ b/odoo_scripts/storage.py @@ -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):