← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1181718] Re: Incorrect logic in api.v2.base.Controller._is_visible

 

** Changed in: quantum
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to quantum.
https://bugs.launchpad.net/bugs/1181718

Title:
  Incorrect logic in api.v2.base.Controller._is_visible

Status in OpenStack Quantum (virtual network service):
  Fix Released

Bug description:
  The following code:

         try:
              attr = (attributes.RESOURCE_ATTRIBUTE_MAP
                      [self._collection].get(attr_name))
              if attr and attr.get('enforce_policy'):
                  authz_check = policy.check_if_exists(
                      context, action, data)
          except KeyError:
              # The extension was not configured for adding its resources
              # to the global resource attribute map. Policy check should
              # not be performed
              LOG.debug(_("The resource %(resource)s was not found in the "
                          "RESOURCE_ATTRIBUTE_MAP; unable to perform authZ "
                          "check for attribute %(attr)s"),
                        {'resource': self._collection,
                         'attr': attr_name})

  Will generate " UnboundLocalError: local variable 'attr' referenced
  before assignment " in case 'attr = ' throws KeyError

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