yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #06924
[Bug 1258656] [NEW] Remove duplication in get_resource for services
Public bug reported:
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)
** Affects: neutron
Importance: Undecided
Status: New
** Tags: fwaas lbaas vpnaas
--
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):
New
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
Follow ups
References