def delete_net_dev(dev):
    if device_exists(dev):
        try:
            utils.execute('ip', 'link', 'delete', dev, run_as_root=True,
                          check_exit_code=[0, 2, 254])
            LOG.debug("Net device removed: '%s'", dev)
        except processutils.ProcessExecutionError:
            with excutils.save_and_reraise_exception():
                LOG.error(_LE("Failed removing net device: '%s'"), dev)
An ugly hack.
dataset/ETHPy150Open openstack/nova/nova/network/linux_net.py/delete_net_dev--crossover with--dataset/ETHPy150Open CenterForOpenScience/scrapi/scrapi/util.py/json_without_bytes