diff options
| author | Vishvananda Ishaya <vishvananda@yahoo.com> | 2010-10-14 21:18:51 +0000 |
|---|---|---|
| committer | Tarmac <> | 2010-10-14 21:18:51 +0000 |
| commit | aec330b34def7158f590ce855d0cd4ff5d0ed41c (patch) | |
| tree | 28dc8ee0f4502b8f82e7843bd3f31905640baa61 /nova/cloudpipe | |
| parent | 3363b133a927509432cb42d77abf18d3d5248abf (diff) | |
| parent | 81cdbc42d41509f629fe8ec0c7605958134e9ed0 (diff) | |
This branch modifies the fixes all of the deprecation warnings about empty context. It does this by adding the following fixes/features
* promotes api/context.py to context.py because it is used by the whole system
* adds more information to the context object
* passes the context through rpc
* adds a helper method for promoting to admin context (elevate())
* modifies most checks to use context.project_id instead of context.project.id to avoid
trips to the database
This included a lot of merge fixing and backporting from the anso deploy branch so some stuff may be broken. Right now it throws an Exception('die') in addition to the deprecation warning so we get a stack trace and can find any other deprecated calls. This needs some testing, especially of the openstack api.
Diffstat (limited to 'nova/cloudpipe')
| -rw-r--r-- | nova/cloudpipe/pipelib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/cloudpipe/pipelib.py b/nova/cloudpipe/pipelib.py index 706a175d9..4fc2c85cb 100644 --- a/nova/cloudpipe/pipelib.py +++ b/nova/cloudpipe/pipelib.py @@ -28,13 +28,13 @@ import os import tempfile import zipfile +from nova import context from nova import exception from nova import flags from nova import utils from nova.auth import manager # TODO(eday): Eventually changes these to something not ec2-specific from nova.api.ec2 import cloud -from nova.api.ec2 import context FLAGS = flags.FLAGS @@ -62,7 +62,7 @@ class CloudPipe(object): key_name = self.setup_key_pair(project.project_manager_id, project_id) zippy = open(zippath, "r") - context = context.APIRequestContext(user=project.project_manager, project=project) + context = context.RequestContext(user=project.project_manager, project=project) reservation = self.controller.run_instances(context, # run instances expects encoded userdata, it is decoded in the get_metadata_call |
