@utils.arg('hostname', metavar='<hostname>', help=_('The hypervisor hostname (or pattern) to search for.'))
def do_hypervisor_servers(cs, args):
 hypers = cs.hypervisors.search(args.hostname, servers=True)
 class InstanceOnHyper(object, ):
  def __init__(self, **kwargs):
   self.__dict__.update(kwargs)
 instances = []
 for hyper in hypers:
  hyper_host = hyper.hypervisor_hostname
  hyper_id = hyper.id
  if hasattr(hyper, 'servers'):
   instances.extend([InstanceOnHyper(id=serv['uuid'], name=serv['name'], hypervisor_hostname=hyper_host, hypervisor_id=hyper_id) for serv in hyper.servers])
 utils.print_list(instances, ['ID', 'Name', 'Hypervisor ID', 'Hypervisor Hostname'])

@ utils . arg ( 'hostname' , metavar = '<hostname>' , help = _ ( 'The hypervisor hostname (or pattern) to search for.' ) ) def do_hypervisor_servers ( cs , args ) : hypers = cs . hypervisors . search ( args . hostname , servers = True ) class InstanceOnHyper ( object , ) : def __init__ ( self , ** kwargs ) : self . __dict__ . update ( kwargs ) instances = [ ] for hyper in hypers : hyper_host = hyper . hypervisor_hostname hyper_id = hyper . id if hasattr ( hyper , 'servers' ) : instances . extend ( [ InstanceOnHyper ( id = serv [ 'uuid' ] , name = serv [ 'name' ] , hypervisor_hostname = hyper_host , hypervisor_id = hyper_id ) for serv in hyper . servers ] ) utils . print_list ( instances , [ 'ID' , 'Name' , 'Hypervisor ID' , 'Hypervisor Hostname' ] )
list servers belonging to specific hypervisors .