← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1258656] Re: Remove duplication in get_resource for services

 

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

** Changed in: neutron
    Milestone: None => icehouse-2

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

Title:
  Remove duplication in get_resource for services

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

Bug description:
  In VPNaaS extension there is a code block in get_resources() that is
  very similar to other services (and with the additions being proposed
  for SSL VPN - two more cases).

  Should consider moving this up into a common module (base.py?) to
  remove duplication (assuming the variations don't make that feasible).

  The block is:

          for collection_name in RESOURCE_ATTRIBUTE_MAP:
              resource_name = plural_mapping.get(
                  collection_name, collection_name[:-1])
              params = RESOURCE_ATTRIBUTE_MAP[collection_name]
              collection_name = collection_name.replace('_', '-')

              quota.QUOTAS.register_resource_by_name(resource_name)
              controller = base.create_resource(
                  collection_name, resource_name, plugin, params,
                  allow_pagination=cfg.CONF.allow_pagination,
                  allow_sorting=cfg.CONF.allow_sorting)

              resource = extensions.ResourceExtension(
                  collection_name,
                  controller,
                  path_prefix=constants.COMMON_PREFIXES[constants.VPN],
                  attr_map=params)
              resources.append(resource)

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


References