Port "Make flavors is_public option .." to v3 tree

The following commit(I5b37fa0bb19683fe1642fd81222547d4a317054e) have
not been merged to v3 tree now, because the commit was merged to the
existing api after porting flavors.py to v3 tree.
 commit b65d506a5f
 Author: Russell Bryant <rbryant@redhat.com>
 Date: Thu Jun 27 21:00:05 2013 +0000
 Make flavors is_public option actually work
This patch ports the commit to v3 tree.
Partially implements blueprint nova-v3-api
Change-Id: I3c7f11c53594118456d0cd62eb1ddf74634b77c3
This commit is contained in:
Ken'ichi Ohmichi
2013年08月14日 13:24:27 +09:00
parent 1889c62aea
commit e220baf1b1

View File

@@ -95,7 +95,7 @@ class FlavorAccessController(object):
authorize(context)
try:
flavor = flavors.get_flavor_by_flavor_id(flavor_id)
flavor = flavors.get_flavor_by_flavor_id(flavor_id, ctxt=context)
except exception.FlavorNotFound as e:
raise webob.exc.HTTPNotFound(explanation=e.format_message())

View File

@@ -93,8 +93,9 @@ class FlavorsController(wsgi.Controller):
@wsgi.serializers(xml=FlavorTemplate)
def show(self, req, id):
"""Return data about the given flavor id."""
context = req.environ['nova.context']
try:
flavor = flavors.get_flavor_by_flavor_id(id)
flavor = flavors.get_flavor_by_flavor_id(id, ctxt=context)
req.cache_db_flavor(flavor)
except exception.FlavorNotFound as e:
raise webob.exc.HTTPNotFound(explanation=e.format_message())

View File

@@ -68,7 +68,7 @@ def fake_get_flavor_access_by_flavor_id(flavorid):
return res
def fake_get_flavor_by_flavor_id(flavorid):
def fake_get_flavor_by_flavor_id(flavorid, ctxt=None):
return INSTANCE_TYPES[flavorid]

View File

@@ -58,7 +58,7 @@ FAKE_FLAVORS = {
}
def fake_flavor_get_by_flavor_id(flavorid):
def fake_flavor_get_by_flavor_id(flavorid, ctxt=None):
return FAKE_FLAVORS['flavor %s' % flavorid]
@@ -98,7 +98,7 @@ def empty_get_all_flavors_sorted_list(context=None, inactive=False,
return []
def return_flavor_not_found(flavor_id):
def return_flavor_not_found(flavor_id, ctxt=None):
raise exception.FlavorNotFound(flavor_id=flavor_id)
Reference in New Issue
openstack/nova
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.