def handle_ipxe_iso(session, instance, cd_vdi, network_info):
    boot_menu_url = CONF.xenserver.ipxe_boot_menu_url
    if not boot_menu_url:
        LOG.warning(_LW('ipxe_boot_menu_url not set, user will have to'
                        ' enter URL manually...'), instance=instance)
        return

    network_name = CONF.xenserver.ipxe_network_name
    if not network_name:
        LOG.warning(_LW('ipxe_network_name not set, user will have to'
                        ' enter IP manually...'), instance=instance)
        return

    network = None
    for vif in network_info:
        if vif['network']['label'] == network_name:
            network = vif['network']
            break

    if not network:
        LOG.warning(_LW("Unable to find network matching '%(network_name)s', "
                        "user will have to enter IP manually..."),
                    {'network_name': network_name}, instance=instance)
        return

    sr_path = get_sr_path(session)

    # Unpack IPv4 network info
    subnet = [sn for sn in network['subnets']
              if sn['version'] == 4][0]
    ip = subnet['ips'][0]

    ip_address = ip['address']
    netmask = network_model.get_netmask(ip, subnet)
    gateway = subnet['gateway']['address']
    dns = subnet['dns'][0]['address']

    try:
        session.call_plugin_serialized("ipxe", "inject", sr_path,
                cd_vdi['uuid'], boot_menu_url, ip_address, netmask,
                gateway, dns, CONF.xenserver.ipxe_mkisofs_cmd)
    except session.XenAPI.Failure as exc:
        _type, _method, error = exc.details[:3]
        if error == 'CommandNotFound':
            LOG.warning(_LW("ISO creation tool '%s' does not exist."),
                        CONF.xenserver.ipxe_mkisofs_cmd, instance=instance)
        else:
            raise
Mark a test as emitting a warning.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/virt/xenapi/vm_utils.py/handle_ipxe_iso--crossover with--dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/testing/assertions.py/emits_warning