'Create a network with a subnet connected to a router.
The baremetal driver is a special case since all nodes are
on the same shared network.
:param tenant_id: id of tenant to create resources in.
:param dns_nameservers: list of dns servers to send to subnet.
:returns: network, subnet, router'

def create_networks(self, networks_client=None, routers_client=None, subnets_client=None, tenant_id=None, dns_nameservers=None, port_security_enabled=True):

    if CONF.network.shared_physical_network:
        if (not CONF.compute.fixed_network_name):
            m = 'fixed_network_name    must    be    specified    in    config'
            raise lib_exc.InvalidConfiguration(m)
        network = self._get_network_by_name(CONF.compute.fixed_network_name)
        router = None
        subnet = None
    else:
        network = self._create_network(networks_client=networks_client, tenant_id=tenant_id, port_security_enabled=port_security_enabled)
        router = self._get_router(client=routers_client, tenant_id=tenant_id)
        subnet_kwargs = dict(network=network, subnets_client=subnets_client, routers_client=routers_client)
        if (dns_nameservers is not None):
            subnet_kwargs['dns_nameservers'] = dns_nameservers
        subnet = self._create_subnet(**subnet_kwargs)
        if (not routers_client):
            routers_client = self.routers_client
        router_id = router['id']
        routers_client.add_router_interface(router_id, subnet_id=subnet['id'])
        self.addCleanup(test_utils.call_and_ignore_notfound_exc, routers_client.remove_router_interface, router_id, subnet_id=subnet['id'])
    return (network, subnet, router)
