Document Compute extension os-security-groups

Bug #1039771 reported by Anne Gentle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Fix Released
High
Tom Fifield

Bug Description

Merged in with https://review.openstack.org/#/c/10815/

This patch adds an output extension for security group output
and modifies the servers code to only allow security groups
to be specified if the os-security-groups extension is
enabled.

Duplicated security group functionality was removed from the
createserverext extension, it is now a duplicate of the servers
endpoint. The boot_from_volume extension was also changed
to inherit the servers functionality so that security_groups
will continue to work. The block_device_mapping code will be
modified in a subsequent patch.

Tests were added for new functionality, and existing tests were
modified slightly. The disk_config extension was modified to be
a bit more lenient so the data for it doesn't need to be mocked
out in other tests.

Tags: compute-api
Revision history for this message
Tom Fifield (fifieldt) wrote :

would be good to get this in before Folsom.

Changed in openstack-manuals:
milestone: none → folsom
Anne Gentle (annegentle)
tags: added: compute-api
Revision history for this message
Tom Fifield (fifieldt) wrote :

The removed code from create-server-ext is:

 22 authorize = extensions.soft_extension_authorizer('compute', 'createserverext')
 23
 24
 25 class ViewBuilder(views.servers.ViewBuilder):
 26 """Adds security group output when viewing server details."""
 27
 28 def show(self, request, instance):
 29 """Detailed view of a single instance."""
 30 server = super(ViewBuilder, self).show(request, instance)
 31 context = request.environ['nova.context']
 32 if authorize(context):
 33 server["server"]["security_groups"] = self._get_groups(instance)
 34 return server
 35
 36 def _get_groups(self, instance):
 37 """Get a list of security groups for this instance."""
 38 groups = instance.get('security_groups')
 39 if groups is not None:
 40 return [{"name": group["name"]} for group in groups]

Tom Fifield (fifieldt)
Changed in openstack-manuals:
assignee: nobody → Tom Fifield (fifieldt)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-manuals (master)

Fix proposed to branch: master
Review: https://review.openstack.org/12932

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-manuals (master)

Reviewed: https://review.openstack.org/12932
Committed: http://github.com/openstack/openstack-manuals/commit/5416206365fd9b17bf0cf3a18fb71e1ababd9491
Submitter: Jenkins
Branch: master

commit 5416206365fd9b17bf0cf3a18fb71e1ababd9491
Author: Tom Fifield <email address hidden>
Date: Thu Sep 13 20:23:22 2012 +1000

    Update createserverext after sec group changes

    fixes bug 1039771

    The patch this bug report mentions removes duplicated security group
    functionality from createserverext, as it's in the servers endpoint.

    This patch just removes the appropriate content

    Change-Id: I191f2b7c37efd54430f6c2eda170708c3695aa38

Changed in openstack-manuals:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.