Skip to content

Commit de4199c

Browse files
committed
wip: Fix pytest_plugin domain factory
1 parent 405326e commit de4199c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

pulpcore/pytest_plugin.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,16 +632,22 @@ def _settings_factory(storage_class=None, storage_settings=None):
632632

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

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

647653
return _settings_factory

0 commit comments

Comments
 (0)