summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorIvan Kolodyazhny <e0ne@e0ne.info>2011-11-24 14:54:30 +0200
committerIvan Kolodyazhny <e0ne@e0ne.info>2011-12-29 11:24:52 +0200
commitc9393f76a3da9cb4a564dab45ddde4f206953dca (patch)
tree032a2246d6fdab05d1043fe7582b704d46354b1d /bin
parent599760a1f8da32f4d689249550d23b3ffc119d0b (diff)
Bug 820059: bin/nova-manage.py VpnCommands.spawn calls non-existant method VpnCommands._vpn_for - fixed
Change-Id: I86c509d98fac685a5d658f397d0672f71b4bc175
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-manage7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index d82d67ea4..8f8bb7149 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):