@classmethod
    def find_network_with_bridge(cls, session, bridge):
        expr = 'field "name__label" = "%s" or ' \
               'field "bridge" = "%s"' % (bridge, bridge)
        networks = session.call_xenapi('network.get_all_records_where', expr)
        if len(networks) == 1:
            return networks.keys()[0]
        elif len(networks) > 1:
            raise Exception(_('Found non-unique network'
                              ' for bridge %s') % bridge)
        else:
            raise Exception(_('Found no network for bridge %s') % bridge)
Return the network on which the bridge is attached, if found.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/xenapi/network_utils.py/NetworkHelper.find_network_with_bridge