summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorLorin Hochstein <lorin@isi.edu>2011-06-16 16:48:20 -0400
committerLorin Hochstein <lorin@isi.edu>2011-06-16 16:48:20 -0400
commita51b2ed4ed4840262bd07d5dfc11e33a32e1accd (patch)
tree1364ed7aac86f805ddba903efa0b43afc6e61112 /bin
parentd68f6de8d8275ec6dd9f231b9b52971f2ad15263 (diff)
parent1763419a3f6b01bb0ef98c700f0f350e756b359c (diff)
downloadnova-a51b2ed4ed4840262bd07d5dfc11e33a32e1accd.tar.gz
nova-a51b2ed4ed4840262bd07d5dfc11e33a32e1accd.tar.xz
nova-a51b2ed4ed4840262bd07d5dfc11e33a32e1accd.zip
Upstream merge
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-manage56
1 files changed, 34 insertions, 22 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 26c0d776c..0147ae21b 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -53,7 +53,6 @@
CLI interface for nova management.
"""
-import datetime
import gettext
import glob
import json
@@ -78,6 +77,7 @@ from nova import crypto
from nova import db
from nova import exception
from nova import flags
+from nova import image
from nova import log as logging
from nova import quota
from nova import rpc
@@ -96,6 +96,7 @@ flags.DECLARE('network_size', 'nova.network.manager')
flags.DECLARE('vlan_start', 'nova.network.manager')
flags.DECLARE('vpn_start', 'nova.network.manager')
flags.DECLARE('fixed_range_v6', 'nova.network.manager')
+flags.DECLARE('gateway_v6', 'nova.network.manager')
flags.DECLARE('images_path', 'nova.image.local')
flags.DECLARE('libvirt_type', 'nova.virt.libvirt.connection')
flags.DEFINE_flag(flags.HelpFlag())
@@ -536,7 +537,7 @@ class FloatingIpCommands(object):
for floating_ip in floating_ips:
instance = None
if floating_ip['fixed_ip']:
- instance = floating_ip['fixed_ip']['instance']['ec2_id']
+ instance = floating_ip['fixed_ip']['instance']['hostname']
print "%s\t%s\t%s" % (floating_ip['host'],
floating_ip['address'],
instance)
@@ -545,13 +546,10 @@ class FloatingIpCommands(object):
class NetworkCommands(object):
"""Class for managing networks."""
- def create(self, fixed_range=None, num_networks=None,
- network_size=None, vlan_start=None,
- vpn_start=None, fixed_range_v6=None, label='public'):
- """Creates fixed ips for host by range
- arguments: fixed_range=FLAG, [num_networks=FLAG],
- [network_size=FLAG], [vlan_start=FLAG],
- [vpn_start=FLAG], [fixed_range_v6=FLAG]"""
+ def create(self, fixed_range=None, num_networks=None, network_size=None,
+ vlan_start=None, vpn_start=None, fixed_range_v6=None,
+ gateway_v6=None, label='public'):
+ """Creates fixed ips for host by range"""
if not fixed_range:
msg = _('Fixed range in the form of 10.0.0.0/8 is '
'required to create networks.')
@@ -567,6 +565,8 @@ class NetworkCommands(object):
vpn_start = FLAGS.vpn_start
if not fixed_range_v6:
fixed_range_v6 = FLAGS.fixed_range_v6
+ if not gateway_v6:
+ gateway_v6 = FLAGS.gateway_v6
net_manager = utils.import_object(FLAGS.network_manager)
try:
net_manager.create_networks(context.get_admin_context(),
@@ -576,6 +576,7 @@ class NetworkCommands(object):
vlan_start=int(vlan_start),
vpn_start=int(vpn_start),
cidr_v6=fixed_range_v6,
+ gateway_v6=gateway_v6,
label=label)
except ValueError, e:
print e
@@ -689,7 +690,7 @@ class ServiceCommands(object):
"""Show a list of all running services. Filter by host & service name.
args: [host] [service]"""
ctxt = context.get_admin_context()
- now = datetime.datetime.utcnow()
+ now = utils.utcnow()
services = db.service_get_all(ctxt)
if host:
services = [s for s in services if s['host'] == host]
@@ -936,7 +937,7 @@ class ImageCommands(object):
"""Methods for dealing with a cloud in an odd state"""
def __init__(self, *args, **kwargs):
- self.image_service = utils.import_object(FLAGS.image_service)
+ self.image_service = image.get_default_image_service()
def _register(self, container_format, disk_format,
path, owner, name=None, is_public='T',
@@ -1081,24 +1082,35 @@ class ImageCommands(object):
self._convert_images(machine_images)
+class ConfigCommands(object):
+ """Class for exposing the flags defined by flag_file(s)."""
+
+ def __init__(self):
+ pass
+
+ def list(self):
+ print FLAGS.FlagsIntoString()
+
+
CATEGORIES = [
- ('user', UserCommands),
('account', AccountCommands),
- ('project', ProjectCommands),
- ('role', RoleCommands),
- ('shell', ShellCommands),
- ('vpn', VpnCommands),
+ ('config', ConfigCommands),
+ ('db', DbCommands),
('fixed', FixedIpCommands),
+ ('flavor', InstanceTypeCommands),
('floating', FloatingIpCommands),
+ ('instance_type', InstanceTypeCommands),
+ ('image', ImageCommands),
('network', NetworkCommands),
- ('vm', VmCommands),
+ ('project', ProjectCommands),
+ ('role', RoleCommands),
('service', ServiceCommands),
- ('db', DbCommands),
+ ('shell', ShellCommands),
+ ('user', UserCommands),
+ ('version', VersionCommands),
+ ('vm', VmCommands),
('volume', VolumeCommands),
- ('instance_type', InstanceTypeCommands),
- ('image', ImageCommands),
- ('flavor', InstanceTypeCommands),
- ('version', VersionCommands)]
+ ('vpn', VpnCommands)]
def lazy_match(name, key_value_tuples):