diff --git a/bin/nova-manage b/bin/nova-manage index 5fcb555b..372d69ea 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -88,6 +88,7 @@ from nova import rpc from nova import utils from nova import version from nova import vsa +from nova.api.ec2 import admin from nova.api.ec2 import ec2utils from nova.auth import manager from nova.cloudpipe import pipelib @@ -174,8 +175,9 @@ class VpnCommands(object): def spawn(self): """Run all VPNs.""" print "WARNING: This method only works with deprecated auth" + ctxt = context.get_admin_context() for p in reversed(self.manager.get_projects()): - if not self._vpn_for(p.id): + if self._vpn_for(ctxt, p.id): print 'spawning %s' % p.id self.pipe.launch_vpn_instance(p.id, p.project_manager_id) time.sleep(10) @@ -211,6 +213,9 @@ class VpnCommands(object): {'vpn_public_address': ip, 'vpn_public_port': int(port)}) + def _vpn_for(self, context, project_id): + return admin.AdminController()._vpn_for(context, project_id) + class ShellCommands(object): def bpython(self):