Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/scripts/before_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ legacy_component_name: "pulpcore"
component_name: "core"
component_version: "${COMPONENT_VERSION}"
pulp_env: {"PULP_CA_BUNDLE": "/etc/pulp/certs/pulp_webserver.crt"}
pulp_settings: {"allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"], "api_root": "/pulp/", "content_path_prefix": "/somewhere/else/", "csrf_trusted_origins": ["https://pulp:443"], "orphan_protection_time": 0, "task_diagnostics": ["memory"], "task_protection_time": 10, "tmpfile_protection_time": 10, "upload_protection_time": 10}
pulp_settings: {"allowed_export_paths": ["/tmp"], "allowed_import_paths": ["/tmp"], "api_root": "/pulp/", "content_path_prefix": "/somewhere/else/", "csrf_trusted_origins": ["https://pulp:443"], "distributed_publication_retention_period": 3, "domain_enabled": true, "orphan_protection_time": 0, "task_diagnostics": ["memory"], "task_protection_time": 10, "tmpfile_protection_time": 10, "upload_protection_time": 10}
pulp_scheme: "https"
image:
name: "pulp"
Expand Down
14 changes: 10 additions & 4 deletions pulpcore/pytest_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,17 +630,23 @@ def _settings_factory(storage_class=None, storage_settings=None):
]

def get_installation_storage_option(key, backend):
value = pulp_settings.STORAGES["default"]["OPTIONS"].get(key)
value = pulp_settings.STORAGES["default"].get("OPTIONS", {}).get(key)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if value:
return value
# Some FileSystem backend options may be defined in the top settings module
if backend == "pulpcore.app.models.storage.FileSystem" and not value:
value = getattr(pulp_settings, key, None)
if backend != "pulpcore.app.models.storage.FileSystem":
return None
value = getattr(pulp_settings, key, None)
return value

storage_settings = storage_settings or dict()
storage_backend = storage_class or pulp_settings.STORAGES["default"]["BACKEND"]
unset_storage_settings = (k for k in keys[storage_backend] if k not in storage_settings)
for key in unset_storage_settings:
storage_settings[key] = get_installation_storage_option(key, storage_backend)
value = get_installation_storage_option(key, storage_backend)
if not value:
continue
storage_settings[key] = value
return storage_backend, storage_settings

return _settings_factory
Expand Down
1 change: 1 addition & 0 deletions template_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pulp_settings:
task_protection_time: 10
tmpfile_protection_time: 10
upload_protection_time: 10
domain_enabled: true
pulp_settings_azure:
MEDIA_ROOT: ""
STORAGES:
Expand Down
Loading