diff --git a/awx/main/isolated/isolated_manager.py b/awx/main/isolated/isolated_manager.py index 72d9f9c58e..1ac035ad4b 100644 --- a/awx/main/isolated/isolated_manager.py +++ b/awx/main/isolated/isolated_manager.py @@ -193,7 +193,7 @@ class IsolatedManager(object): isolated_ssh_path = None try: if getattr(settings, 'AWX_ISOLATED_PRIVATE_KEY', None): - isolated_ssh_path = tempfile.mkdtemp(prefix='ansible_awx_isolated', dir=settings.AWX_PROOT_BASE_PATH) + isolated_ssh_path = tempfile.mkdtemp(prefix='awx_isolated', dir=settings.AWX_PROOT_BASE_PATH) os.chmod(isolated_ssh_path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR) isolated_key = os.path.join(isolated_ssh_path, '.isolated') ssh_sock = os.path.join(isolated_ssh_path, '.isolated_ssh_auth.sock') diff --git a/awx/main/scheduler/__init__.py b/awx/main/scheduler/__init__.py index 3e83c759d8..fbbb8b0fb5 100644 --- a/awx/main/scheduler/__init__.py +++ b/awx/main/scheduler/__init__.py @@ -161,7 +161,7 @@ class TaskManager(): job.save(update_fields=['status', 'job_explanation']) connection.on_commit(lambda: job.websocket_emit_status('failed')) - # TODO: should we emit a status on the socket here similar to tasks.py tower_periodic_scheduler() ? + # TODO: should we emit a status on the socket here similar to tasks.py awx_periodic_scheduler() ? #emit_websocket_notification('/socket.io/jobs', '', dict(id=)) # See comment in tasks.py::RunWorkflowJob::run() diff --git a/awx/main/tasks.py b/awx/main/tasks.py index c8def0fc59..0608f1c5bd 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -213,7 +213,7 @@ def cluster_node_heartbeat(self): @task(bind=True, base=LogErrorsTask) -def tower_isolated_heartbeat(self): +def awx_isolated_heartbeat(self): local_hostname = settings.CLUSTER_HOST_ID logger.debug("Controlling node checking for any isolated management tasks.") poll_interval = settings.AWX_ISOLATED_PERIODIC_CHECK @@ -237,7 +237,7 @@ def tower_isolated_heartbeat(self): @task(bind=True, queue='tower', base=LogErrorsTask) -def tower_periodic_scheduler(self): +def awx_periodic_scheduler(self): run_now = now() state = TowerScheduleState.get_solo() last_run = state.schedule_last_run diff --git a/awx/main/tests/functional/test_tasks.py b/awx/main/tests/functional/test_tasks.py index 065d979819..24451abbdd 100644 --- a/awx/main/tests/functional/test_tasks.py +++ b/awx/main/tests/functional/test_tasks.py @@ -6,7 +6,7 @@ from django.utils.timezone import now, timedelta from awx.main.tasks import ( RunProjectUpdate, RunInventoryUpdate, - tower_isolated_heartbeat, + awx_isolated_heartbeat, isolated_manager ) from awx.main.models import ( @@ -121,7 +121,7 @@ class TestIsolatedManagementTask: original_isolated_instance = needs_updating.instances.all().first() with mock.patch('awx.main.tasks.settings', MockSettings()): with mock.patch.object(isolated_manager.IsolatedManager, 'health_check') as check_mock: - tower_isolated_heartbeat() + awx_isolated_heartbeat() iso_instance = Instance.objects.get(hostname='isolated') call_args, _ = check_mock.call_args assert call_args[0][0] == iso_instance @@ -131,7 +131,7 @@ class TestIsolatedManagementTask: def test_does_not_take_action(self, control_instance, just_updated): with mock.patch('awx.main.tasks.settings', MockSettings()): with mock.patch.object(isolated_manager.IsolatedManager, 'health_check') as check_mock: - tower_isolated_heartbeat() + awx_isolated_heartbeat() iso_instance = Instance.objects.get(hostname='isolated') check_mock.assert_not_called() assert iso_instance.capacity == 103 diff --git a/awx/main/tests/unit/settings/test_defaults.py b/awx/main/tests/unit/settings/test_defaults.py index 894289002d..52eeb56425 100644 --- a/awx/main/tests/unit/settings/test_defaults.py +++ b/awx/main/tests/unit/settings/test_defaults.py @@ -6,7 +6,7 @@ from datetime import timedelta @pytest.mark.parametrize("job_name,function_path", [ ('admin_checks', 'awx.main.tasks.run_administrative_checks'), - ('tower_scheduler', 'awx.main.tasks.tower_periodic_scheduler'), + ('tower_scheduler', 'awx.main.tasks.awx_periodic_scheduler'), ]) def test_CELERYBEAT_SCHEDULE(mocker, job_name, function_path): assert job_name in settings.CELERYBEAT_SCHEDULE diff --git a/awx/settings/defaults.py b/awx/settings/defaults.py index d076e234ea..b8dfc97f28 100644 --- a/awx/settings/defaults.py +++ b/awx/settings/defaults.py @@ -445,7 +445,7 @@ CELERY_ROUTES = {'awx.main.scheduler.tasks.run_task_manager': {'queue': 'tower', CELERYBEAT_SCHEDULE = { 'tower_scheduler': { - 'task': 'awx.main.tasks.tower_periodic_scheduler', + 'task': 'awx.main.tasks.awx_periodic_scheduler', 'schedule': timedelta(seconds=30), 'options': {'expires': 20,} }, diff --git a/awx/settings/development.py b/awx/settings/development.py index 1dc7bb8688..cb6834ee2d 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -126,7 +126,7 @@ CELERY_ROUTES['awx.main.tasks.cluster_node_heartbeat'] = {'queue': CLUSTER_HOST_ # Production only runs this schedule on controlling nodes # but development will just run it on all nodes CELERYBEAT_SCHEDULE['isolated_heartbeat'] = { - 'task': 'awx.main.tasks.tower_isolated_heartbeat', + 'task': 'awx.main.tasks.awx_isolated_heartbeat', 'schedule': timedelta(seconds = AWX_ISOLATED_PERIODIC_CHECK), 'options': {'expires': AWX_ISOLATED_PERIODIC_CHECK * 2,} }