Navigation Menu

Skip to content

Commit

Permalink
Bug 820059: bin/nova-manage.py VpnCommands.spawn calls non-existant m…
Browse files Browse the repository at this point in the history
…ethod VpnCommands._vpn_for - fixed

Change-Id: I86c509d98fac685a5d658f397d0672f71b4bc175
  • Loading branch information
e0ne authored and markmc committed Jan 4, 2012
1 parent b4cfd9a commit fc37582
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Authors
Expand Up @@ -48,6 +48,7 @@ Hisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>
Hisaki Ohara <hisaki.ohara@intel.com>
Ilya Alekseyev <ilyaalekseyev@acm.org>
Isaku Yamahata <yamahata@valinux.co.jp>
Ivan Kolodyazhny <e0ne@e0ne.info>
Jake Dahn <jake@ansolabs.com>
James E. Blair <jeblair@hp.com>
Jason Cannavale <jason.cannavale@rackspace.com>
Expand Down
7 changes: 6 additions & 1 deletion bin/nova-manage
Expand Up @@ -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
Expand Down Expand Up @@ -175,8 +176,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)
Expand Down Expand Up @@ -212,6 +214,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):
Expand Down

0 comments on commit fc37582

Please sign in to comment.