Skip to content

Commit df41208

Browse files
committed
wip: Fix pytest_plugin domain factory
1 parent e03e705 commit df41208

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

pulpcore/pytest_plugin.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,17 +630,23 @@ def _settings_factory(storage_class=None, storage_settings=None):
630630
]
631631

632632
def get_installation_storage_option(key, backend):
633-
value = pulp_settings.STORAGES["default"]["OPTIONS"].get(key)
633+
value = pulp_settings.STORAGES["default"].get("OPTIONS", {}).get(key)
634+
if value:
635+
return value
634636
# Some FileSystem backend options may be defined in the top settings module
635-
if backend == "pulpcore.app.models.storage.FileSystem" and not value:
636-
value = getattr(pulp_settings, key, None)
637+
if backend != "pulpcore.app.models.storage.FileSystem":
638+
return None
639+
value = getattr(pulp_settings, key, None)
637640
return value
638641

639642
storage_settings = storage_settings or dict()
640643
storage_backend = storage_class or pulp_settings.STORAGES["default"]["BACKEND"]
641644
unset_storage_settings = (k for k in keys[storage_backend] if k not in storage_settings)
642645
for key in unset_storage_settings:
643-
storage_settings[key] = get_installation_storage_option(key, storage_backend)
646+
value = get_installation_storage_option(key, storage_backend)
647+
if not value:
648+
continue
649+
storage_settings[key] = value
644650
return storage_backend, storage_settings
645651

646652
return _settings_factory

0 commit comments

Comments
 (0)