def test_deletion(site, client):
    ifc_uri = site.list_uri('interface')
    dev_uri = site.list_uri('device')

    dev1_resp = client.create(dev_uri, hostname='foo-bar1')
    dev1 = get_result(dev1_resp)

    # Create Interfaces
    dev1_eth0_resp = client.create(ifc_uri, device=dev1['id'], name='eth0')
    dev1_eth0 = get_result(dev1_eth0_resp)
    dev1_eth0_uri = site.detail_uri('interface', id=dev1_eth0['id'])

    dev1_eth1_resp = client.create(
        ifc_uri, device=dev1['id'], name='eth1', parent_id=dev1_eth0['id']
    )
    dev1_eth1 = get_result(dev1_eth1_resp)
    dev1_eth1_uri = site.detail_uri('interface', id=dev1_eth1['id'])

    # Don't allow delete when there's a child Interface
    assert_error(client.delete(dev1_eth0_uri), status.HTTP_409_CONFLICT)

    # Delete the child Interface
    client.delete(dev1_eth1_uri)

    # And safely delete the parent Network
    assert_deleted(client.delete(dev1_eth0_uri))
Callback function to be passed to GreenThread.link() when we spawn()
dataset/ETHPy150Open dropbox/nsot/tests/api_tests/test_interfaces.py/test_deletion--crossover with--dataset/ETHPy150Open openstack/rack/rack/openstack/common/threadgroup.py/_thread_done