Ejemplo n.º 1
0
def _diag_network(context, network, fields):
    if not network:
        return False
    net_driver = registry.DRIVER_REGISTRY.get_driver(network["network_plugin"])
    net = v._make_network_dict(network)
    net['ports'] = [p.get('id') for p in network.get('ports', [])]
    if 'subnets' in fields:
        net['subnets'] = [subnets.diagnose_subnet(context, s, fields)
                          for s in network.get('subnets', [])]
    if 'ports' in fields:
        net['ports'] = [ports.diagnose_port(context, s, fields)
                        for s in net['ports']]
    if 'config' in fields or 'status' in fields:
        net.update(net_driver.diag_network(
            context, net['id'], get_status='status' in fields))
    return net
Ejemplo n.º 2
0
def _diag_network(context, network, fields):
    if not network:
        return False
    net_driver = registry.DRIVER_REGISTRY.get_driver(network["network_plugin"])
    net = v._make_network_dict(network)
    net['ports'] = [p.get('id') for p in network.get('ports', [])]
    if 'subnets' in fields:
        net['subnets'] = [
            subnets.diagnose_subnet(context, s, fields)
            for s in network.get('subnets', [])
        ]
    if 'ports' in fields:
        net['ports'] = [
            ports.diagnose_port(context, s, fields) for s in net['ports']
        ]
    if 'config' in fields or 'status' in fields:
        net.update(
            net_driver.diag_network(context,
                                    net['id'],
                                    get_status='status' in fields))
    return net
Ejemplo n.º 3
0
 def diagnose_subnet(self, context, id, fields):
     return subnets.diagnose_subnet(context, id, fields)
Ejemplo n.º 4
0
 def diagnose_subnet(self, context, id, fields):
     return subnets.diagnose_subnet(context, id, fields)