Merge pull request #3092 from chrismeyersfsu/remove-label_cleanup_job

forgot to remove label cleanup periodic task
This commit is contained in:
Chris Meyers 2016-07-22 12:20:27 -04:00 committed by GitHub
commit b6ff1d8c21
4 changed files with 0 additions and 24 deletions

View File

@ -47,7 +47,6 @@ from django.contrib.auth.models import User
from awx.main.constants import CLOUD_PROVIDERS
from awx.main.models import * # noqa
from awx.main.models import UnifiedJob
from awx.main.models.label import Label
from awx.main.queue import FifoQueue
from awx.main.conf import tower_settings
from awx.main.task_engine import TaskSerializer, TASK_TIMEOUT_INTERVAL
@ -123,13 +122,6 @@ def run_administrative_checks(self):
tower_admin_emails,
fail_silently=True)
@task(bind=True)
def run_label_cleanup(self):
qs = Label.get_orphaned_labels()
labels_count = qs.count()
qs.delete()
return labels_count
@task(bind=True)
def cleanup_authtokens(self):
AuthToken.objects.filter(expires__lt=now()).delete()

View File

@ -4,7 +4,6 @@ from django.conf import settings
from datetime import timedelta
@pytest.mark.parametrize("job_name,function_path", [
('label_cleanup', 'awx.main.tasks.run_label_cleanup'),
('admin_checks', 'awx.main.tasks.run_administrative_checks'),
('tower_scheduler', 'awx.main.tasks.tower_periodic_scheduler'),
])

View File

@ -7,7 +7,6 @@ from awx.main.models import (
)
from awx.main.tasks import (
run_label_cleanup,
send_notifications,
run_administrative_checks,
)
@ -21,16 +20,6 @@ def apply_patches(_patches):
yield
[p.stop() for p in _patches]
def test_run_label_cleanup(mocker):
qs = mocker.Mock(**{'count.return_value': 3, 'delete.return_value': None})
mock_label = mocker.patch('awx.main.models.label.Label.get_orphaned_labels',return_value=qs)
ret = run_label_cleanup()
mock_label.assert_called_with()
qs.delete.assert_called_with()
assert 3 == ret
def test_send_notifications_not_list():
with pytest.raises(TypeError):
send_notifications(None)

View File

@ -345,10 +345,6 @@ CELERYBEAT_SCHEDULE = {
'task': 'awx.main.tasks.run_administrative_checks',
'schedule': timedelta(days=30)
},
'label_cleanup': {
'task': 'awx.main.tasks.run_label_cleanup',
'schedule': timedelta(days=7)
},
'authtoken_cleanup': {
'task': 'awx.main.tasks.cleanup_authtokens',
'schedule': timedelta(days=30)