Project

Profile

Help

Story #5290

closed

As a plugin writer, I can provide all of my settings with their defaults in one place.

Added by bmbouter over 5 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 58
Quarter:

Description

Problem

Currently pulp_ansible has several settings. There isn't a consolidated way currently for dynaconf to overlay settings from the pulp_ansible codebase onto the settings file provided by pulpcore.app.settings

Solution

1. Document in the plugin writer's guide a convention that settings should live in pluginname.app.settings

2. Then here you build the list of python paths to the settings file.

3. Then here you have dynaconf load those settings.

This needs to come with documentation for plugin writers and a release note in pulpcore-plugin, even though the changes will mostly occur in pulpcore.

Actions #2

Updated by daviddavis over 5 years ago

  • Groomed changed from No to Yes
Actions #3

Updated by rochacbruno over 5 years ago

Dynaconf PR: https://github.com/rochacbruno/dynaconf/pull/209

That RFC will be included in the next release

Actions #4

Updated by rochacbruno over 5 years ago

Dynaconf 2.0.4 released adding support for this issue to be resolved: https://github.com/rochacbruno/dynaconf/releases/tag/2.0.4

Actions #5

Updated by Anonymous over 5 years ago

  • Status changed from NEW to MODIFIED
  • % Done changed from 0 to 100
Actions #6

Updated by bmbouter over 5 years ago

  • Status changed from MODIFIED to ASSIGNED
  • Assignee set to bmbouter

@bruno awesome thanks! I'm bringing back to ASSIGNED so I can add documentation for plugin writers.

Actions #7

Updated by bmbouter over 5 years ago

  • Sprint set to Sprint 58

This was groomed for the last sprint planning but it did not have the Sprint actually set. This is needed for core to allow pulp_ansible to set settings so we need to have it on the sprint.

Actions #8

Updated by bmbouter over 5 years ago

  • Status changed from ASSIGNED to POST
Actions #9

Updated by Anonymous over 5 years ago

  • Status changed from POST to MODIFIED

Added by Bruno Rocha over 5 years ago

Revision 00bbe2ca | View on GitHub

Add load of plugin default settings.

  • Includes default settings from {plugin_name}/app/settings.py
  • This settings overrides the data existing in /etc/pulp/settings.py
  • This settings are overridden by env vars prefixed with PULP_
  • So a good practice for plugin writers is to prefix the default configs with plugin name such as RPM, FILE, ANSIBLE etc...

example:

ANSIBLE_SOMEKEY = 'value' on settings.py can be overriden via export PULP_ANSIBLE_SOMEKEY='othervalue'

closes #5290

Actions #10

Updated by bmbouter over 5 years ago

  • Status changed from MODIFIED to POST
Actions #11

Updated by bmbouter over 5 years ago

  • Status changed from POST to ASSIGNED
Actions #12

Updated by bmbouter over 5 years ago

  • Status changed from ASSIGNED to POST

Added by bmbouter over 5 years ago

Revision 2120cd3b | View on GitHub

Add settings.py.j2 for plugin settings

Plugins now have their settings loaded when placed in the file at <your plugin>.app.settings.py.

https://pulp.plan.io/issues/5290 closes #5290

Actions #13

Updated by bmbouter over 5 years ago

  • Status changed from POST to MODIFIED
Actions #14

Updated by bmbouter over 5 years ago

  • Status changed from MODIFIED to POST

PR for settings.py added to plugin_template: https://github.com/pulp/plugin_template/pull/104

Bringing back to POST for the docs PR to merge and move to MODIFIED.

Actions #15

Updated by bmbouter over 5 years ago

  • Status changed from POST to MODIFIED

Applied in changeset commit:pulpcore-plugin|d2af53939a82933f0fb2a92962f44fa9de688f7b.

Actions #16

Updated by bmbouter about 5 years ago

  • Sprint/Milestone set to 3.0.0
Actions #17

Updated by bmbouter about 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF