From b6a310000e49c88f9270d4edae597dbc25b57851 Mon Sep 17 00:00:00 2001 From: John Garbutt Date: Tue, 4 Jun 2019 16:47:10 +0100 Subject: [PATCH] Ensure we pass a target in admin actions blueprint policy-defaults-refresh Change-Id: Iccc1931ff2c2800aeb5519f58c2be1f0f0f3e527 --- nova/api/openstack/compute/admin_actions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/api/openstack/compute/admin_actions.py b/nova/api/openstack/compute/admin_actions.py index 1873dabe393f..c1208df49925 100644 --- a/nova/api/openstack/compute/admin_actions.py +++ b/nova/api/openstack/compute/admin_actions.py @@ -40,7 +40,7 @@ class AdminActionsController(wsgi.Controller): def _reset_network(self, req, id, body): """Permit admins to reset networking on a server.""" context = req.environ['nova.context'] - context.can(aa_policies.POLICY_ROOT % 'reset_network') + context.can(aa_policies.POLICY_ROOT % 'reset_network', target={}) instance = common.get_instance(self.compute_api, context, id) try: self.compute_api.reset_network(context, instance) @@ -53,7 +53,7 @@ class AdminActionsController(wsgi.Controller): def _inject_network_info(self, req, id, body): """Permit admins to inject network info into a server.""" context = req.environ['nova.context'] - context.can(aa_policies.POLICY_ROOT % 'inject_network_info') + context.can(aa_policies.POLICY_ROOT % 'inject_network_info', target={}) instance = common.get_instance(self.compute_api, context, id) try: self.compute_api.inject_network_info(context, instance) @@ -67,7 +67,7 @@ class AdminActionsController(wsgi.Controller): def _reset_state(self, req, id, body): """Permit admins to reset the state of a server.""" context = req.environ["nova.context"] - context.can(aa_policies.POLICY_ROOT % 'reset_state') + context.can(aa_policies.POLICY_ROOT % 'reset_state', target={}) # Identify the desired state from the body state = state_map[body["os-resetState"]["state"]]