summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorEwan Mellor <emellor@silver>2010-10-03 13:12:32 +0100
committerEwan Mellor <emellor@silver>2010-10-03 13:12:32 +0100
commit4fa2258af9fb130be1650372cf48be39e83451e5 (patch)
tree56cec5f01e7979a7ef2ef8d9891092d781f173be /nova
parent4d13a8554459638387d772a23fffe6aaaab3348d (diff)
Bug #654025: nova-manage project zip and nova-manage vpn list broken by change in DB semantics when networks are missing
Catch exception.NotFound when getting project VPN data. This is in two places: nova-manage as part of its vpn list command, and auth.manager.AuthManager.get_credentials. Also, document the behaviour of db.api.project_get_network.
Diffstat (limited to 'nova')
-rw-r--r--nova/auth/manager.py5
-rw-r--r--nova/db/api.py6
2 files changed, 9 insertions, 2 deletions
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)