Add a helpful error message to nova-manage in case of NoMoreNetworks.

This is one of the most common problems people have, and the solution
is not currently easily discoverable. This should address that.
This commit is contained in:
Soren Hansen 2010-12-02 15:18:45 +01:00
parent f8afbcc08b
commit 1e050bb4a8
1 changed files with 8 additions and 3 deletions

View File

@ -359,9 +359,14 @@ class ProjectCommands(object):
def zipfile(self, project_id, user_id, filename='nova.zip'):
"""Exports credentials for project to a zip file
arguments: project_id user_id [filename='nova.zip]"""
zip_file = self.manager.get_credentials(user_id, project_id)
with open(filename, 'w') as f:
f.write(zip_file)
try:
zip_file = self.manager.get_credentials(user_id, project_id)
with open(filename, 'w') as f:
f.write(zip_file)
except db.api.NoMoreNetworks:
print ('No more networks available. If this is a new '
'installation, you need\nto call something like this:\n\n'
' nova-manage network create 10.0.0.0/8 10 64\n\n')
class FloatingIpCommands(object):