summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/nova-manage9
-rw-r--r--nova/auth/manager.py5
-rw-r--r--nova/db/api.py6
3 files changed, 16 insertions, 4 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index bf3c67612..5293fc942 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -88,11 +88,16 @@ class VpnCommands(object):
def list(self):
"""Print a listing of the VPNs for all projects."""
print "%-12s\t" % 'project',
- print "%-12s\t" % 'ip:port',
+ print "%-20s\t" % 'ip:port',
print "%s" % 'state'
for project in self.manager.get_projects():
print "%-12s\t" % project.name,
- print "%s:%s\t" % (project.vpn_ip, project.vpn_port),
+
+ try:
+ s = "%s:%s" % (project.vpn_ip, project.vpn_port)
+ except exception.NotFound:
+ s = "None"
+ print "%-20s\t" % s,
vpn = self._vpn_for(project.id)
if vpn:
diff --git a/nova/auth/manager.py b/nova/auth/manager.py
index 0bc12c80f..c30192e20 100644
--- a/nova/auth/manager.py
+++ b/nova/auth/manager.py
@@ -653,7 +653,10 @@ class AuthManager(object):
zippy.writestr(FLAGS.credential_key_file, private_key)
zippy.writestr(FLAGS.credential_cert_file, signed_cert)
- (vpn_ip, vpn_port) = self.get_project_vpn_data(project)
+ try:
+ (vpn_ip, vpn_port) = self.get_project_vpn_data(project)
+ except exception.NotFound:
+ vpn_ip = None
if vpn_ip:
configfile = open(FLAGS.vpn_client_template, "r")
s = string.Template(configfile.read())
diff --git a/nova/db/api.py b/nova/db/api.py
index 5c935b561..d34f1b2cb 100644
--- a/nova/db/api.py
+++ b/nova/db/api.py
@@ -432,7 +432,11 @@ def network_update(context, network_id, values):
def project_get_network(context, project_id):
- """Return the network associated with the project."""
+ """Return the network associated with the project.
+
+ Raises NotFound if no such network can be found.
+
+ """
return IMPL.project_get_network(context, project_id)