Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,8 @@ develop:
$(PYTHON) setup.py develop; \
fi

version_file:
mkdir -p /var/lib/ascender/; \
if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \
fi; \
$(PYTHON) -c "import ascender; print(ascender.__version__)" > /var/lib/ascender/.ascender_version; \

## Refresh development environment after pulling new code.
refresh: clean requirements_dev version_file develop migrate
refresh: clean requirements_dev develop migrate

## Create Django superuser.
adduser:
Expand Down
20 changes: 1 addition & 19 deletions ascender/api/serializers/bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
WorkflowJobNode,
WorkflowJobTemplate,
)
from ascender.main.utils import parse_yaml_or_json, get_licenser
from ascender.main.utils import parse_yaml_or_json
from ascender.main.signals import update_inventory_computed_fields
from ascender.api.versioning import reverse
from ascender.api.serializers.host import (
Expand Down Expand Up @@ -72,10 +72,6 @@ class Meta:
read_only_fields = ()

def raise_if_host_counts_violated(self, attrs):
from ascender.api.serializers.base import logger

validation_info = get_licenser().validate()

org = attrs['inventory'].organization

if org:
Expand All @@ -91,20 +87,6 @@ def raise_if_host_counts_violated(self, attrs):
)
)

# Don't check license if it is open license
if validation_info.get('license_type', 'UNLICENSED') == 'open':
return

sys_free_instances = validation_info.get('free_instances', 0)
system_net_new_host_count = Host.objects.exclude(name__in=new_hosts).count()

if system_net_new_host_count > sys_free_instances:
hard_error = validation_info.get('trial', False) is True or validation_info['instance_count'] == 10
if hard_error:
# Only raise permission error for trial, otherwise just log a warning as we do in other inventory import situations
raise PermissionDenied(_("Host count exceeds available instances."))
logger.warning(_("Number of hosts allowed by license has been exceeded."))

def validate(self, attrs):
request = self.context.get('request', None)
inv = attrs['inventory']
Expand Down
26 changes: 13 additions & 13 deletions ascender/api/templates/api/api_v2_config_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ the following fields (some fields may not be visible to all users):
* `project_local_paths`: List of directories beneath `project_base_dir` to
use when creating/editing a manual project.
* `time_zone`: The configured time zone for the server.
* `license_info`: Information about the current license.
* `version`: Version of Ansible Tower package installed.
* `eula`: The current End-User License Agreement
* `version`: Version of the Ascender package installed.
* `analytics_status`: Whether user analytics tracking is off, anonymous or
detailed.
* `become_methods`: The privilege escalation methods available to a job.
* `user_ldap_fields`: Present when LDAP is enabled: the user fields LDAP
manages, which are read-only for a user with an `ldap_dn`.
{% endifmeth %}

{% ifmeth POST %}
# Install or update an existing license
# No licence to install

(_New in Ansible Tower 2.0.0_) Make a POST request to this resource as a super
user to install or update the existing license. The license data itself can
be POSTed as a normal json data structure.

(_New in Ansible Tower 2.1.1_) The POST must include a `eula_accepted` boolean
element indicating acceptance of the End-User License Agreement.
Ascender does not use subscriptions. This method took a Red Hat entitlement
manifest and answers `400` instead, rather than a bare `405`, so a client that
posts one is told why.
{% endifmeth %}

{% ifmeth DELETE %}
# Delete an existing license
# No licence to remove

(_New in Ansible Tower 2.0.0_) Make a DELETE request to this resource as a super
user to delete the existing license
Ascender does not use subscriptions. This method cleared the installed licence
and answers `400`, the same way POST does.
{% endifmeth %}
31 changes: 0 additions & 31 deletions ascender/api/urls/analytics.py

This file was deleted.

3 changes: 0 additions & 3 deletions ascender/api/urls/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
from ascender.api.views.mesh_visualizer import MeshVisualizer

from ascender.api.views.metrics import MetricsView
from ascender.api.views.analytics import AWX_ANALYTICS_API_PREFIX

from .organization import urls as organization_urls
from .user import urls as user_urls
Expand Down Expand Up @@ -95,7 +94,6 @@
from .workflow_approval_template import urls as workflow_approval_template_urls
from .workflow_approval import urls as workflow_approval_urls
from .workflow_approval_vote import urls as workflow_approval_vote_urls
from .analytics import urls as analytics_urls
from .receptor_address import urls as receptor_address_urls

v2_urls = [
Expand Down Expand Up @@ -159,7 +157,6 @@
path('unified_job_templates/', UnifiedJobTemplateList.as_view(), name='unified_job_template_list'),
path('unified_jobs/', UnifiedJobList.as_view(), name='unified_job_list'),
path('activity_stream/', include(activity_stream_urls)),
path(f'{AWX_ANALYTICS_API_PREFIX}/', include(analytics_urls)),
path('workflow_approval_templates/', include(workflow_approval_template_urls)),
path('workflow_approvals/', include(workflow_approval_urls)),
path('workflow_approval_votes/', include(workflow_approval_vote_urls)),
Expand Down
Loading
Loading