'Helper method to determine if we can auto-allocate networks
:param context: nova request context
:param neutron: neutron client
:returns: True if it\'s possible to auto-allocate networks, False
otherwise.'

def _can_auto_allocate_network(self, context, neutron):

    if self._has_auto_allocate_extension(context, neutron=neutron):
        try:
            neutron.validate_auto_allocated_topology_requirements(context.project_id)
            LOG.debug('Network    auto-allocation    is    available    for    project    %s', context.project_id)
        except neutron_client_exc.Conflict as ex:
            LOG.debug('Unable    to    auto-allocate    networks.    %s', six.text_type(ex))
        else:
            return True
    else:
        LOG.debug('Unable    to    auto-allocate    networks.    The    neutron    auto-allocated-topology    extension    is    not    available.')
    return False
