From 394713eaef63f28f5ea298aeac4ae1f7c76fa167 Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Mon, 11 Feb 2013 10:06:36 -0800 Subject: Fix regression in non-admin simple_usage:show. Commit 6ff32210772a67a1b526d9d784030afc90f3ce99 optimized the db query for usage but replaced a call that had require_context with one that had require_admin_context. This causes usage show to throw a 403. We check for admin_or_owner in policy, so there is no need to check for admin context at the db layer. Fixes bug 1122267 Change-Id: Iff362f46d83a710f3883538bcb646e3457e0ba64 --- nova/db/sqlalchemy/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index d0a58e44f..ce56bedf5 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -1656,7 +1656,7 @@ def regex_filter(query, model, filters): return query -@require_admin_context +@require_context def instance_get_active_by_window_joined(context, begin, end=None, project_id=None, host=None): """Return instances and joins that were active during window.""" -- cgit