Fix typo in policy.json and checks in nicira plugin

Bug 1155379

This patch removes extra colons from policy.json.
Also, it fixes some checks in the nicira plugin which were not
passing correctly the target resource for the policy engine.

Change-Id: I89a1d170818173eaa90b50158289a06455febadc
This commit is contained in:
Salvatore Orlando 2013-03-15 01:31:31 +01:00
parent 3630d2f46b
commit 95f677d7f3
2 changed files with 6 additions and 8 deletions

View File

@ -51,9 +51,9 @@
"delete_service_type": "rule:admin_only",
"get_service_type": "rule:regular_user",
"create_qos_queue:": "rule:admin_only",
"get_qos_queue:": "rule:admin_only",
"get_qos_queues:": "rule:admin_only",
"create_qos_queue": "rule:admin_only",
"get_qos_queue": "rule:admin_only",
"get_qos_queues": "rule:admin_only",
"update_agent": "rule:admin_only",
"delete_agent": "rule:admin_only",

View File

@ -2208,10 +2208,9 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
sgrid)
def create_qos_queue(self, context, qos_queue, check_policy=True):
if check_policy:
self._enforce_set_auth(context, qos_queue,
ext_qos.qos_queue_create)
q = qos_queue.get('qos_queue')
if check_policy:
self._enforce_set_auth(context, q, ext_qos.qos_queue_create)
self._validate_qos_queue(context, q)
q['id'] = nvplib.create_lqueue(self.default_cluster,
self._nvp_lqueue(q))
@ -2229,8 +2228,7 @@ class NvpPluginV2(db_base_plugin_v2.QuantumDbPluginV2,
return super(NvpPluginV2, self).delete_qos_queue(context, id)
def get_qos_queue(self, context, id, fields=None):
if not self._check_view_auth(context, {'qos_queue': None},
ext_qos.qos_queue_get):
if not self._check_view_auth(context, {}, ext_qos.qos_queue_get):
# don't want the user to find out that they guessed the right id
# so we raise not found if the policy.json file doesn't allow them
raise ext_qos.QueueNotFound(id=id)