summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-06-03 14:41:25 -0700
committerAnthony Young <sleepsonthefloor@gmail.com>2011-06-03 14:41:25 -0700
commit9ada213e500cc3233c048d834791924947545a67 (patch)
treebabee3653edf4d1bf13520997990202c14fc8bd7 /bin
parent5c205bb5ef1565db4e52af538cf0d6b73cbeda37 (diff)
parentf903911a078f4356b91cb7d0965456612b26698c (diff)
resolve conflicts with trunk
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-dhcpbridge7
-rwxr-xr-xbin/nova-manage49
2 files changed, 47 insertions, 9 deletions
diff --git a/bin/nova-dhcpbridge b/bin/nova-dhcpbridge
index f42dfd6b5..5926b97de 100755
--- a/bin/nova-dhcpbridge
+++ b/bin/nova-dhcpbridge
@@ -108,6 +108,13 @@ def main():
interface = os.environ.get('DNSMASQ_INTERFACE', FLAGS.dnsmasq_interface)
if int(os.environ.get('TESTING', '0')):
from nova.tests import fake_flags
+
+ #if FLAGS.fake_rabbit:
+ # LOG.debug(_("leasing ip"))
+ # network_manager = utils.import_object(FLAGS.network_manager)
+ ## reload(fake_flags)
+ # from nova.tests import fake_flags
+
action = argv[1]
if action in ['add', 'del', 'old']:
mac = argv[2]
diff --git a/bin/nova-manage b/bin/nova-manage
index db964064d..26c0d776c 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -97,7 +97,7 @@ flags.DECLARE('vlan_start', 'nova.network.manager')
flags.DECLARE('vpn_start', 'nova.network.manager')
flags.DECLARE('fixed_range_v6', 'nova.network.manager')
flags.DECLARE('images_path', 'nova.image.local')
-flags.DECLARE('libvirt_type', 'nova.virt.libvirt_conn')
+flags.DECLARE('libvirt_type', 'nova.virt.libvirt.connection')
flags.DEFINE_flag(flags.HelpFlag())
flags.DEFINE_flag(flags.HelpshortFlag())
flags.DEFINE_flag(flags.HelpXMLFlag())
@@ -362,27 +362,47 @@ class ProjectCommands(object):
def add(self, project_id, user_id):
"""Adds user to project
arguments: project_id user_id"""
- self.manager.add_to_project(user_id, project_id)
+ try:
+ self.manager.add_to_project(user_id, project_id)
+ except exception.UserNotFound as ex:
+ print ex
+ raise
def create(self, name, project_manager, description=None):
"""Creates a new project
arguments: name project_manager [description]"""
- self.manager.create_project(name, project_manager, description)
+ try:
+ self.manager.create_project(name, project_manager, description)
+ except exception.UserNotFound as ex:
+ print ex
+ raise
def modify(self, name, project_manager, description=None):
"""Modifies a project
arguments: name project_manager [description]"""
- self.manager.modify_project(name, project_manager, description)
+ try:
+ self.manager.modify_project(name, project_manager, description)
+ except exception.UserNotFound as ex:
+ print ex
+ raise
def delete(self, name):
"""Deletes an existing project
arguments: name"""
- self.manager.delete_project(name)
+ try:
+ self.manager.delete_project(name)
+ except exception.ProjectNotFound as ex:
+ print ex
+ raise
def environment(self, project_id, user_id, filename='novarc'):
"""Exports environment variables to an sourcable file
arguments: project_id user_id [filename='novarc]"""
- rc = self.manager.get_environment_rc(user_id, project_id)
+ try:
+ rc = self.manager.get_environment_rc(user_id, project_id)
+ except (exception.UserNotFound, exception.ProjectNotFound) as ex:
+ print ex
+ raise
with open(filename, 'w') as f:
f.write(rc)
@@ -397,18 +417,26 @@ class ProjectCommands(object):
arguments: project_id [key] [value]"""
ctxt = context.get_admin_context()
if key:
+ if value.lower() == 'unlimited':
+ value = None
try:
db.quota_update(ctxt, project_id, key, value)
- except exception.NotFound:
+ except exception.ProjectQuotaNotFound:
db.quota_create(ctxt, project_id, key, value)
- project_quota = quota.get_quota(ctxt, project_id)
+ project_quota = quota.get_project_quotas(ctxt, project_id)
for key, value in project_quota.iteritems():
+ if value is None:
+ value = 'unlimited'
print '%s: %s' % (key, value)
def remove(self, project_id, user_id):
"""Removes user from project
arguments: project_id user_id"""
- self.manager.remove_from_project(user_id, project_id)
+ try:
+ self.manager.remove_from_project(user_id, project_id)
+ except (exception.UserNotFound, exception.ProjectNotFound) as ex:
+ print ex
+ raise
def scrub(self, project_id):
"""Deletes data associated with project
@@ -427,6 +455,9 @@ class ProjectCommands(object):
zip_file = self.manager.get_credentials(user_id, project_id)
with open(filename, 'w') as f:
f.write(zip_file)
+ except (exception.UserNotFound, exception.ProjectNotFound) as ex:
+ print ex
+ raise
except db.api.NoMoreNetworks:
print _('No more networks available. If this is a new '
'installation, you need\nto call something like this:\n\n'