summaryrefslogtreecommitdiff
path: root/nova/context.py
diff options
context:
space:
mode:
authorTony Breeds <tony@bakeyournoodle.com>2016-07-15 14:49:54 +1000
committerTony Breeds <tony@bakeyournoodle.com>2016-07-27 18:09:30 -0500
commit80738df83f4cdd7a3143b157b73d1a9e6b3b2c40 (patch)
treea154eb473c82378715cf5cc0ef993b6d3c815786 /nova/context.py
parent66127c563ef31f2fdfe26c3dc9a5ad2f31b5da20 (diff)
downloadnova-80738df83f4cdd7a3143b157b73d1a9e6b3b2c40.tar.gz
Add support for oslo.context 2.6.0
The 2.6.0 release of oslo.context adds a new attribute 'is_admin_project'. Always include that attribute when serializing the object, and expect it in our tests. Change-Id: I563cf810385e84ab30d49ef079b75df279006f0d Related-Bug: 1602081
Diffstat (limited to 'nova/context.py')
-rw-r--r--nova/context.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/nova/context.py b/nova/context.py
index 60f2b3f4c4..22e194a0fd 100644
--- a/nova/context.py
+++ b/nova/context.py
@@ -174,6 +174,13 @@ class RequestContext(context.RequestContext):
'instance_lock_checked': getattr(self, 'instance_lock_checked',
False)
})
+ # NOTE(tonyb): This can be removed once we're certain to have a
+ # RequestContext contains 'is_admin_project', We can only get away with
+ # this because we "know" the default value of 'is_admin_project' which
+ # is very fragile.
+ values.update({
+ 'is_admin_project': getattr(self, 'is_admin_project', True),
+ })
return values
@classmethod