~cloudbuilders/nova/os-keypair-integration

« back to all changes in this revision

Viewing changes to nova/cloudpipe/pipelib.py

  • Committer: Jesse Andrews
  • Date: 2011-08-26 21:57:53 UTC
  • mfrom: (1455.1.45 nova)
  • Revision ID: anotherjesse@gmail.com-20110826215753-0sfp6dubujsl23wa
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from nova import flags
35
35
from nova import log as logging
36
36
from nova import utils
37
 
from nova.auth import manager
38
37
# TODO(eday): Eventually changes these to something not ec2-specific
39
38
from nova.api.ec2 import cloud
40
39
 
57
56
class CloudPipe(object):
58
57
    def __init__(self):
59
58
        self.controller = cloud.CloudController()
60
 
        self.manager = manager.AuthManager()
61
59
 
62
60
    def get_encoded_zip(self, project_id):
63
61
        # Make a payload.zip
93
91
        zippy.close()
94
92
        return encoded
95
93
 
96
 
    def launch_vpn_instance(self, project_id):
 
94
    def launch_vpn_instance(self, project_id, user_id):
97
95
        LOG.debug(_("Launching VPN for %s") % (project_id))
98
 
        project = self.manager.get_project(project_id)
99
 
        ctxt = context.RequestContext(user=project.project_manager_id,
100
 
                                      project=project.id)
 
96
        ctxt = context.RequestContext(user_id=user_id,
 
97
                                      project_id=project_id)
101
98
        key_name = self.setup_key_pair(ctxt)
102
99
        group_name = self.setup_security_group(ctxt)
103
100