Renamed 'nova-manage server list' -> 'nova-manage host list' to differentiate physical hosts from VMs

This commit is contained in:
Mike Scherbakov
2011-07-12 11:07:30 -07:00
parent e74e66f69c
commit 7398cce6c9

View File

@@ -816,11 +816,11 @@ class ServiceCommands(object):
{"method": "update_available_resource"}) {"method": "update_available_resource"})
class ServerCommands(object): class HostCommands(object):
"""List servers""" """List hosts"""
def list(self, zone=None): def list(self, zone=None):
"""Show a list of all servers. Filter by zone. """Show a list of all physical hosts. Filter by zone.
args: [zone]""" args: [zone]"""
print "%-25s\t%-15s" % (_('host'), print "%-25s\t%-15s" % (_('host'),
_('zone')) _('zone'))
@@ -829,13 +829,13 @@ class ServerCommands(object):
services = db.service_get_all(ctxt) services = db.service_get_all(ctxt)
if zone: if zone:
services = [s for s in services if s['availability_zone'] == zone] services = [s for s in services if s['availability_zone'] == zone]
servers = [] hosts = []
for srv in services: for srv in services:
if not [s for s in servers if s['host'] == srv['host']]: if not [h for h in hosts if h['host'] == srv['host']]:
servers.append(srv) hosts.append(srv)
for srv in servers: for h in hosts:
print "%-25s\t%-15s" % (srv['host'], srv['availability_zone']) print "%-25s\t%-15s" % (h['host'], h['availability_zone'])
class DbCommands(object): class DbCommands(object):
@@ -1211,13 +1211,13 @@ CATEGORIES = [
('fixed', FixedIpCommands), ('fixed', FixedIpCommands),
('flavor', InstanceTypeCommands), ('flavor', InstanceTypeCommands),
('floating', FloatingIpCommands), ('floating', FloatingIpCommands),
('host', HostCommands),
('instance_type', InstanceTypeCommands), ('instance_type', InstanceTypeCommands),
('image', ImageCommands), ('image', ImageCommands),
('network', NetworkCommands), ('network', NetworkCommands),
('project', ProjectCommands), ('project', ProjectCommands),
('role', RoleCommands), ('role', RoleCommands),
('service', ServiceCommands), ('service', ServiceCommands),
('server', ServerCommands),
('shell', ShellCommands), ('shell', ShellCommands),
('user', UserCommands), ('user', UserCommands),
('version', VersionCommands), ('version', VersionCommands),