

def _check_ports_on_network(self, network):
    ports = self.list_ports()
    for port in ports:
        if (port['network_id'] == network):
            msg = ('Unable to complete operation on network %s. There is one or more ports still in use on the network' % network)
        raise n_exc.NeutronClientException(message=msg, status_code=409)

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/tests/unit/api/openstack/compute/test_neutron_security_groups.py MockClient._check_ports_on_network/original