← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1424765] [NEW] Adding exceptions in Horizon plug-in it overrides instead of add.

 

Public bug reported:

When you add exceptions in an Horizon plug-in (using the ADD_EXCEPTIONS
dictionary) it overrides instead of adding them to the Horizon known
exceptions list ('recoverable', 'non_found', 'unauthorized').

We've solved it like this (openstack_dashboard/utils/settings.py):

replace this line: horizon_config.setdefault('exceptions', {}).update(exceptions)
with:
# Append (not replace) plug-in exceptions.
horizon_config.setdefault('exceptions', {})
for except_key in exceptions.keys():
    if except_key in horizon_config['exceptions']:
        horizon_config['exceptions'][except_key] += exceptions[except_key]
    else:
        horizon_config['exceptions'][except_key] = exceptions[except_key]

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
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/1424765

Title:
  Adding exceptions in Horizon plug-in it overrides instead of add.

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  When you add exceptions in an Horizon plug-in (using the
  ADD_EXCEPTIONS dictionary) it overrides instead of adding them to the
  Horizon known exceptions list ('recoverable', 'non_found',
  'unauthorized').

  We've solved it like this (openstack_dashboard/utils/settings.py):

  replace this line: horizon_config.setdefault('exceptions', {}).update(exceptions)
  with:
  # Append (not replace) plug-in exceptions.
  horizon_config.setdefault('exceptions', {})
  for except_key in exceptions.keys():
      if except_key in horizon_config['exceptions']:
          horizon_config['exceptions'][except_key] += exceptions[except_key]
      else:
          horizon_config['exceptions'][except_key] = exceptions[except_key]

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


Follow ups

References