← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2122800] [NEW] ADD_TEMPLATE_DIRS does not work with local_settings.d snippets

 

Public bug reported:

The ADD_TEMPLATE_DIRS variable in openstack_dashboard/settings.py is
added to TEMPLATES[0]['DIRS'] after local_settings is imported, but
before local settings snippets are loaded. This means the
ADD_TEMPLATE_DIRS variable is ineffective when using the
LOCAL_SETTINGS_DIR_PATH folder.

The configure templates code should be moved to run after the settings
snippets have been loaded.

The workaround for this is to include the entire line
`TEMPLATES[0]['DIRS'] += ADD_TEMPLATE_DIRS` in a local settings snippet.

For reference:
https://opendev.org/openstack/horizon/src/commit/54f710ff815a4f45615bd111bc7ca45f6beb562c/openstack_dashboard/settings.py#L250

This affects kolla-ansible, as they only support adding to the Horizon
settings with snippets.

** Affects: horizon
     Importance: Undecided
         Status: New

** Affects: kolla-ansible
     Importance: Undecided
         Status: New

** Also affects: kolla-ansible
   Importance: Undecided
       Status: New

** Description changed:

  The ADD_TEMPLATE_DIRS variable in openstack_dashboard/settings.py is
  added to TEMPLATES[0]['DIRS'] after local_settings is imported, but
  before local settings snippets are loaded. This means the
  ADD_TEMPLATE_DIRS variable is ineffective when using the
  LOCAL_SETTINGS_DIR_PATH folder.
  
  The configure templates code should be moved to run after the settings
  snippets have been loaded.
  
  The workaround for this is to include the entire line
  `TEMPLATES[0]['DIRS'] += ADD_TEMPLATE_DIRS` in a local settings snippet.
  
  For reference:
  https://opendev.org/openstack/horizon/src/commit/54f710ff815a4f45615bd111bc7ca45f6beb562c/openstack_dashboard/settings.py#L250
+ 
+ This affects kolla-ansible, as they only support adding to the Horizon
+ settings with snippets.

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/2122800

Title:
  ADD_TEMPLATE_DIRS does not work with local_settings.d snippets

Status in OpenStack Dashboard (Horizon):
  New
Status in kolla-ansible:
  New

Bug description:
  The ADD_TEMPLATE_DIRS variable in openstack_dashboard/settings.py is
  added to TEMPLATES[0]['DIRS'] after local_settings is imported, but
  before local settings snippets are loaded. This means the
  ADD_TEMPLATE_DIRS variable is ineffective when using the
  LOCAL_SETTINGS_DIR_PATH folder.

  The configure templates code should be moved to run after the settings
  snippets have been loaded.

  The workaround for this is to include the entire line
  `TEMPLATES[0]['DIRS'] += ADD_TEMPLATE_DIRS` in a local settings
  snippet.

  For reference:
  https://opendev.org/openstack/horizon/src/commit/54f710ff815a4f45615bd111bc7ca45f6beb562c/openstack_dashboard/settings.py#L250

  This affects kolla-ansible, as they only support adding to the Horizon
  settings with snippets.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/2122800/+subscriptions