'Build the network topology and returns its network UUID.'

def _build_topology(self, context, tenant_id, default_external_network):

    try:
        subnets = self._provision_tenant_private_network(context, tenant_id)
        network_id = subnets[0]['network_id']
        router = self._provision_external_connectivity(context, default_external_network, subnets, tenant_id)
        network_id = self._save(context, tenant_id, network_id, router['id'], subnets)
        return network_id
    except exceptions.UnknownProvisioningError as e:
        LOG.error(_LE('Unknown    error    while    provisioning    topology    for    tenant    %(tenant_id)s.    Reason:    %(reason)s'), {'tenant_id': tenant_id, 'reason': e})
        self._cleanup(context, network_id=e.network_id, router_id=e.router_id, subnets=e.subnets)
        raise e.error
