def list(self): ctxt = context.get_admin_context() cells = db.cell_get_all(ctxt) fmt = "%3s %-10s %-6s %-10s %-15s %-5s %-10s" print fmt % ('Id', 'Name', 'Type', 'Username', 'Hostname', 'Port', 'VHost') print fmt % ('-' * 3, '-' * 10, '-' * 6, '-' * 10, '-' * 15, '-' * 5, '-' * 10) for cell in cells: print fmt % (cell.id, cell.name, 'parent' if cell.is_parent else 'child', cell.username, cell.rpc_host, cell.rpc_port, cell.rpc_virtual_host) print fmt % ('-' * 3, '-' * 10, '-' * 6, '-' * 10, '-' * 15, '-' * 5, '-' * 10)
def list(self): ctxt = context.get_admin_context() cells = db.cell_get_all(ctxt) fmt = "%3s %-10s %-6s %-10s %-15s %-5s %-10s" print(fmt % ('Id', 'Name', 'Type', 'Username', 'Hostname', 'Port', 'VHost')) print(fmt % ('-' * 3, '-' * 10, '-' * 6, '-' * 10, '-' * 15, '-' * 5, '-' * 10)) for cell in cells: url = rpc.get_transport_url(cell.transport_url) host = url.hosts[0] if url.hosts else messaging.TransportHost() print(fmt % (cell.id, cell.name, 'parent' if cell.is_parent else 'child', host.username, host.hostname, host.port, url.virtual_host)) print(fmt % ('-' * 3, '-' * 10, '-' * 6, '-' * 10, '-' * 15, '-' * 5, '-' * 10))
def list(self): ctxt = context.get_admin_context() cells = db.cell_get_all(ctxt) fmt = "%3s %-10s %-6s %-10s %-15s %-5s %-10s" print fmt % ("Id", "Name", "Type", "Username", "Hostname", "Port", "VHost") print fmt % ("-" * 3, "-" * 10, "-" * 6, "-" * 10, "-" * 15, "-" * 5, "-" * 10) for cell in cells: print fmt % ( cell.id, cell.name, "parent" if cell.is_parent else "child", cell.username, cell.rpc_host, cell.rpc_port, cell.rpc_virtual_host, ) print fmt % ("-" * 3, "-" * 10, "-" * 6, "-" * 10, "-" * 15, "-" * 5, "-" * 10)