fix a few bugs with the session and oauth2 cleanup scheduled jobs

see: https://github.com/ansible/tower/issues/3940
This commit is contained in:
Ryan Petrello
2019-11-25 11:50:09 -05:00
parent deb8714987
commit 632810f3a8
4 changed files with 30 additions and 20 deletions

View File

@@ -2731,10 +2731,11 @@ class RunSystemJob(BaseTask):
json_vars = {}
else:
json_vars = json.loads(system_job.extra_vars)
if 'days' in json_vars:
args.extend(['--days', str(json_vars.get('days', 60))])
if 'dry_run' in json_vars and json_vars['dry_run']:
args.extend(['--dry-run'])
if system_job.job_type in ('cleanup_jobs', 'cleanup_activitystream'):
if 'days' in json_vars:
args.extend(['--days', str(json_vars.get('days', 60))])
if 'dry_run' in json_vars and json_vars['dry_run']:
args.extend(['--dry-run'])
if system_job.job_type == 'cleanup_jobs':
args.extend(['--jobs', '--project-updates', '--inventory-updates',
'--management-jobs', '--ad-hoc-commands', '--workflow-jobs',