Skip to content
Draft
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
2 changes: 1 addition & 1 deletion awx/api/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def get_field_info(self, field):
pass
if field.field_name == 'type':
field_info['type'] = 'choice'
elif field.field_name in ('url', 'custom_virtualenv', 'token'):
elif field.field_name in ('url', 'token'):
field_info['type'] = 'string'
elif field.field_name in ('related', 'summary_fields'):
field_info['type'] = 'object'
Expand Down
19 changes: 6 additions & 13 deletions awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1321,8 +1321,8 @@ class OrganizationSerializer(BaseSerializer):

class Meta:
model = Organization
fields = ('*', 'max_hosts', 'custom_virtualenv', 'default_environment')
read_only_fields = ('*', 'custom_virtualenv')
fields = ('*', 'max_hosts', 'default_environment')
read_only_fields = ('*',)
Comment on lines 1322 to +1325
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With custom_virtualenv removed from these serializers, several UI components still referencing *.custom_virtualenv become dead code and may render incorrect legacy warnings. Please update the UI to remove/replace custom_virtualenv usages (or provide a compatibility shim) to complete the feature removal end-to-end.

Copilot uses AI. Check for mistakes.

def get_related(self, obj):
res = super(OrganizationSerializer, self).get_related(obj)
Expand Down Expand Up @@ -1490,14 +1490,13 @@ class Meta:
'scm_update_on_launch',
'scm_update_cache_timeout',
'allow_override',
'custom_virtualenv',
'default_environment',
'signature_validation_credential',
) + (
'last_update_failed',
'last_updated',
) # Backwards compatibility
read_only_fields = ('*', 'custom_virtualenv')
read_only_fields = ('*',)

def get_related(self, obj):
res = super(ProjectSerializer, self).get_related(obj)
Expand Down Expand Up @@ -2359,12 +2358,11 @@ class Meta:
'host_filter',
'overwrite',
'overwrite_vars',
'custom_virtualenv',
'timeout',
'verbosity',
'limit',
)
read_only_fields = ('*', 'custom_virtualenv')
read_only_fields = ('*',)

def get_related(self, obj):
res = super(InventorySourceOptionsSerializer, self).get_related(obj)
Expand Down Expand Up @@ -2568,8 +2566,6 @@ def validate(self, attrs):


class InventoryUpdateSerializer(UnifiedJobSerializer, InventorySourceOptionsSerializer):
custom_virtualenv = serializers.ReadOnlyField()

class Meta:
model = InventoryUpdate
fields = (
Expand All @@ -2579,7 +2575,6 @@ class Meta:
'license_error',
'org_host_limit_error',
'source_project_update',
'custom_virtualenv',
'instance_group',
'scm_revision',
)
Expand Down Expand Up @@ -3288,13 +3283,12 @@ class Meta:
'become_enabled',
'diff_mode',
'allow_simultaneous',
'custom_virtualenv',
'job_slice_count',
'webhook_service',
'webhook_credential',
'prevent_instance_group_fallback',
)
read_only_fields = ('*', 'custom_virtualenv')
read_only_fields = ('*',)

def get_related(self, obj):
res = super(JobTemplateSerializer, self).get_related(obj)
Expand Down Expand Up @@ -3461,11 +3455,10 @@ def get_summary_fields(self, obj):

class JobDetailSerializer(JobSerializer):
playbook_counts = serializers.SerializerMethodField(help_text=_('A count of all plays and tasks for the job run.'))
custom_virtualenv = serializers.ReadOnlyField()

class Meta:
model = Job
fields = ('*', 'host_status_counts', 'playbook_counts', 'custom_virtualenv')
fields = ('*', 'host_status_counts', 'playbook_counts')

def get_playbook_counts(self, obj):
task_count = obj.get_event_queryset().filter(event='playbook_on_task_start').count()
Expand Down
3 changes: 1 addition & 2 deletions awx/api/templates/api/api_v2_config_view.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ the following fields (some fields may not be visible to all users):
* `time_zone`: The configured time zone for the server.
* `license_info`: Information about the current license.
* `version`: Version of Ansible Tower package installed.
* `custom_virtualenvs`: Deprecated venv locations from before migration to
execution environments. Export tooling is in `awx-manage` commands.

* `eula`: The current End-User License Agreement
{% endifmeth %}

Expand Down
7 changes: 2 additions & 5 deletions awx/api/views/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
from awx.conf.registry import settings_registry
from awx.main.analytics import all_collectors
from awx.main.ha import is_ha_environment
from awx.main.utils import get_awx_version, get_custom_venv_choices
from awx.main.utils import get_awx_version
from awx.main.utils.licensing import validate_entitlement_manifest
from awx.api.versioning import reverse, drf_reverse
from awx.main.constants import PRIVILEGE_ESCALATION_METHODS
from awx.main.models import Project, Organization, Instance, InstanceGroup, JobTemplate
from awx.main.models import Project, Organization, Instance, InstanceGroup
from awx.main.utils import set_environ
from awx.main.utils.licensing import get_licenser

Expand Down Expand Up @@ -314,11 +314,8 @@ def get(self, request, format=None):
dict(
project_base_dir=settings.PROJECTS_ROOT,
project_local_paths=Project.get_local_path_choices(),
custom_virtualenvs=get_custom_venv_choices(),
)
)
elif JobTemplate.accessible_objects(request.user, 'admin_role').exists():
data['custom_virtualenvs'] = get_custom_venv_choices()

return Response(data)

Expand Down
1 change: 0 additions & 1 deletion awx/main/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -1664,7 +1664,6 @@ def changes_are_non_sensitive(self, obj, data):
'ask_inventory_on_launch',
'ask_credential_on_launch',
'survey_enabled',
'custom_virtualenv',
'diff_mode',
'timeout',
'job_slice_count',
Expand Down
9 changes: 0 additions & 9 deletions awx/main/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,6 @@
category_slug='system',
)

register(
'CUSTOM_VENV_PATHS',
field_class=fields.StringListPathField,
label=_('Custom virtual environment paths'),
help_text=_('Paths where Tower will look for custom virtual environments (in addition to /var/lib/awx/venv/). Enter one path per line.'),
category=_('System'),
category_slug='system',
default=[],
)

register(
'AD_HOC_COMMANDS',
Expand Down
59 changes: 0 additions & 59 deletions awx/main/management/commands/custom_venv_associations.py

This file was deleted.

48 changes: 0 additions & 48 deletions awx/main/management/commands/export_custom_venv.py

This file was deleted.

43 changes: 0 additions & 43 deletions awx/main/management/commands/list_custom_venvs.py

This file was deleted.

37 changes: 37 additions & 0 deletions awx/main/migrations/0195_remove_custom_virtualenv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Generated for custom venv removal

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
('main', '0194_add_github_app_credential'),
]

operations = [
migrations.RemoveField(
model_name='inventorysource',
name='custom_virtualenv',
),
migrations.RemoveField(
model_name='inventoryupdate',
name='custom_virtualenv',
),
migrations.RemoveField(
model_name='job',
name='custom_virtualenv',
),
migrations.RemoveField(
model_name='jobtemplate',
name='custom_virtualenv',
),
migrations.RemoveField(
model_name='organization',
name='custom_virtualenv',
),
migrations.RemoveField(
model_name='project',
name='custom_virtualenv',
),
]
1 change: 0 additions & 1 deletion awx/main/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
ROLE_SINGLETON_SYSTEM_AUDITOR,
)
from awx.main.models.mixins import ( # noqa
CustomVirtualEnvMixin,
ExecutionEnvironmentMixin,
ResourceMixin,
SurveyJobMixin,
Expand Down
5 changes: 2 additions & 3 deletions awx/main/models/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
ResourceMixin,
TaskManagerInventoryUpdateMixin,
RelatedJobsMixin,
CustomVirtualEnvMixin,
)
from awx.main.models.notifications import (
NotificationTemplate,
Expand Down Expand Up @@ -1093,7 +1092,7 @@ def credential(self):
source_vars_dict = VarsDictProperty('source_vars')


class InventorySource(UnifiedJobTemplate, InventorySourceOptions, CustomVirtualEnvMixin, RelatedJobsMixin):
class InventorySource(UnifiedJobTemplate, InventorySourceOptions, RelatedJobsMixin):
SOFT_UNIQUE_TOGETHER = [('polymorphic_ctype', 'name', 'inventory')]

class Meta:
Expand Down Expand Up @@ -1269,7 +1268,7 @@ def _get_related_jobs(self):
return InventoryUpdate.objects.filter(inventory_source=self)


class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin, TaskManagerInventoryUpdateMixin, CustomVirtualEnvMixin):
class InventoryUpdate(UnifiedJob, InventorySourceOptions, JobNotificationMixin, TaskManagerInventoryUpdateMixin):
"""
Internal job for tracking inventory updates from external sources.
"""
Expand Down
Loading