From 5e3da5864825a12da5a1ea1102a6efb6cebe204b Mon Sep 17 00:00:00 2001 From: Vishvananda Ishaya Date: Fri, 1 Oct 2010 05:57:17 -0700 Subject: Fix the deprecation warnings for passing no context. Moved RequestContext out of nova.api, because it is used by everything Context is passed through the queue. Added some helper methods for converting to admin context. Added a few more fields to request context. --- nova/cloudpipe/pipelib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nova/cloudpipe') 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 -- cgit