diff options
author | Rick Harris <rconradharris@gmail.com> | 2012-02-08 06:52:14 +0000 |
---|---|---|
committer | Mark Washenberger <mark.washenberger@rackspace.com> | 2012-02-09 09:34:17 -0500 |
commit | f33de5c9ad6217a9daa1bafd8f1d3e71f618dda2 (patch) | |
tree | ee87897a6e8b2b6b1c045505eb4bce3ab51de20e /nova/context.py | |
parent | 1815aaf13af1c5d6d4225fa0f8f4adb2b10548e6 (diff) | |
download | nova-f33de5c9ad6217a9daa1bafd8f1d3e71f618dda2.tar.gz nova-f33de5c9ad6217a9daa1bafd8f1d3e71f618dda2.tar.xz nova-f33de5c9ad6217a9daa1bafd8f1d3e71f618dda2.zip |
Fix confirm_resize policy handling
Fixes bug 928649
markwash:
- fixed pep8 violation
Change-Id: Ie1c3136256dac0e350e430ac7c69eba4cb98b158
Diffstat (limited to 'nova/context.py')
-rw-r--r-- | nova/context.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/context.py b/nova/context.py index b0c0603a8..d9735e3d2 100644 --- a/nova/context.py +++ b/nova/context.py @@ -51,6 +51,8 @@ class RequestContext(object): self.is_admin = is_admin if self.is_admin is None: self.is_admin = 'admin' in [x.lower() for x in self.roles] + elif self.is_admin and 'admin' not in self.roles: + self.roles.append('admin') self.read_deleted = read_deleted self.remote_address = remote_address if not timestamp: @@ -87,6 +89,9 @@ class RequestContext(object): context = copy.copy(self) context.is_admin = True + if 'admin' not in context.roles: + context.roles.append('admin') + if read_deleted is not None: context.read_deleted = read_deleted |