diff --git a/CHANGES.rst b/CHANGES.rst index 09060b6..cabd860 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,11 @@ Changelog ========= +2.1.2 (2024-08-09) +------------------ + +- Fix missing default in PLONE_SITE_PREFIX_PATH [jensens] + 2.1.1 (2024-08-02) ------------------ diff --git a/pyproject.toml b/pyproject.toml index 2818681..06ff4d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "collective.elastic.ingest" -version = "2.1.1" +version = "2.1.2" description = "Ingestion service queue runner between Plone RestAPI and ElasticSearch or OpenSearch." keywords = ["elasticsearch", "opensearch", "plone", "celery", "search", "indexer"] readme = "README.rst" diff --git a/src/collective/elastic/ingest/plone.py b/src/collective/elastic/ingest/plone.py index 9f015aa..a885677 100644 --- a/src/collective/elastic/ingest/plone.py +++ b/src/collective/elastic/ingest/plone.py @@ -38,12 +38,12 @@ def _full_url(path): return "/".join([plone_base_url, path]) if prefix_handling == "strip": - prefix_path = str(os.environ.get("PLONE_SITE_PREFIX_PATH")).strip("/") + prefix_path = str(os.environ.get("PLONE_SITE_PREFIX_PATH", "Plone")).strip("/") path_parts = path.split("/")[len(prefix_path.split("/")) :] return "/".join([plone_base_url] + path_parts) raise ValueError( - f"PLONE_SITE_PREFIX_METHOD must be one of keep, strip or add, not {prefix_handling}" + f"PLONE_SITE_PREFIX_METHOD must be either 'keep' or 'strip', got '{prefix_handling}'" ) @@ -51,7 +51,7 @@ def _schema_url(): """return the url to fetch the schema from""" url = [str(os.environ.get("PLONE_SERVICE"))] if str(os.environ.get("PLONE_SITE_PREFIX_METHOD", "keep")).strip() == "keep": - url.append(str(os.environ.get("PLONE_SITE_PREFIX_PATH"))) + url.append(str(os.environ.get("PLONE_SITE_PREFIX_PATH", "Plone"))) url.append("@cesp-schema") return "/".join(url)