Project

Profile

Help

Issue #3879

closed

Issue #3981: Switch Pulp3 settings to Dynaconf

Cannot opt out of settings defaults due to merging of settings

Added by ehelms@redhat.com over 5 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Quarter:

Description

Issue

The pointed issue is that if I want to configure pure console logging (for container environments) I cannot. The syslog handler gets configured and attempts to connect failing. If I try to set my logging configuration like the following, the syslog handler I explicitly try to exclude is added:

logging:
  formatters:
    simple:
      format: "pulp: %(name)s:%(levelname)s: %(message)s"
  handlers:
    console:
      class: logging.StreamHandler
      formatter: simple
  loggers:
    '':
      handlers: ["console"]
      level: INFO

I have had to hack around this for now via -- https://github.com/ehelms/pulp/commit/8e82d27a6294c2db139ce2ffc41002cc70309777

How can I only use my settings and not "merge" with the defaults.

Solution

Update the behavior to be an 'overwrite' from the top level of each. The merge could would only replace user values for default values for the keys: DATABASES, logging, ..., PROFILING

https://github.com/pulp/pulp/blob/12919c2040b3de1a061e647f1f59e7494294d600/pulpcore/pulpcore/app/settings.py#L219-L240

Also available in: Atom PDF