diff options
| author | Ken Pepple <ken.pepple@gmail.com> | 2011-04-07 11:12:14 -0700 |
|---|---|---|
| committer | Ken Pepple <ken.pepple@gmail.com> | 2011-04-07 11:12:14 -0700 |
| commit | fcf358cacd8f993faaf64310307956686a7d330b (patch) | |
| tree | df679e6df14b0ecd1d9de912685c5ef95f543232 | |
| parent | a782dad0d1effeaebdfb59ad87b88b42c93991ed (diff) | |
| download | nova-fcf358cacd8f993faaf64310307956686a7d330b.tar.gz nova-fcf358cacd8f993faaf64310307956686a7d330b.tar.xz nova-fcf358cacd8f993faaf64310307956686a7d330b.zip | |
moved -manage instance list command to -manage vm list to avoid lazy match conflict with instance_types
| -rwxr-xr-x | bin/nova-manage | 85 |
1 files changed, 40 insertions, 45 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index 6789efba8..bd3f9f50d 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -570,6 +570,45 @@ class NetworkCommands(object): class VmCommands(object): """Class for mangaging VM instances.""" + def list(self, host=None, instance=None): + """Show a list of all instances""" + print "%-10s %-15s %-10s %-10s %-19s %-12s %-12s %-12s" \ + " %-10s %-10s %-10s %-5s" % ( + _('instance'), + _('node'), + _('type'), + _('state'), + _('launched'), + _('image'), + _('kernel'), + _('ramdisk'), + _('project'), + _('user'), + _('zone'), + _('index')) + + if host == None: + instances = db.instance_get_all(context.get_admin_context()) + else: + instances = db.instance_get_all_by_host( + context.get_admin_context(), host) + + for instance in instances: + print "%-10s %-15s %-10s %-10s %-19s %-12s %-12s %-12s" \ + " %-10s %-10s %-10s %-5d" % ( + instance['hostname'], + instance['host'], + instance['instance_type'], + instance['state_description'], + instance['launched_at'], + instance['image_id'], + instance['kernel_id'], + instance['ramdisk_id'], + instance['project_id'], + instance['user_id'], + instance['availability_zone'], + instance['launch_index']) + def live_migration(self, ec2_id, dest): """Migrates a running instance to a new machine. @@ -725,49 +764,6 @@ class DbCommands(object): print migration.db_version() -class InstanceCommands(object): - """Class for managing instances.""" - - def list(self, host=None, instance=None): - """Show a list of all instances""" - print "%-10s %-15s %-10s %-10s %-19s %-12s %-12s %-12s" \ - " %-10s %-10s %-10s %-5s" % ( - _('instance'), - _('node'), - _('type'), - _('state'), - _('launched'), - _('image'), - _('kernel'), - _('ramdisk'), - _('project'), - _('user'), - _('zone'), - _('index')) - - if host == None: - instances = db.instance_get_all(context.get_admin_context()) - else: - instances = db.instance_get_all_by_host( - context.get_admin_context(), host) - - for instance in instances: - print "%-10s %-15s %-10s %-10s %-19s %-12s %-12s %-12s" \ - " %-10s %-10s %-10s %-5d" % ( - instance['hostname'], - instance['host'], - instance['instance_type'], - instance['state_description'], - instance['launched_at'], - instance['image_id'], - instance['kernel_id'], - instance['ramdisk_id'], - instance['project_id'], - instance['user_id'], - instance['availability_zone'], - instance['launch_index']) - - class VolumeCommands(object): """Methods for dealing with a cloud in an odd state""" @@ -1054,8 +1050,7 @@ CATEGORIES = [ ('volume', VolumeCommands), ('instance_type', InstanceTypeCommands), ('image', ImageCommands), - ('flavor', InstanceTypeCommands), - ('instance', InstanceCommands)] + ('flavor', InstanceTypeCommands)] def lazy_match(name, key_value_tuples): |
