mirror of
https://github.com/ansible/awx.git
synced 2024-10-31 15:21:13 +03:00
Fix up direct launching of system jobs
This commit is contained in:
parent
a40120d1cf
commit
fb8d7e5d9c
@ -1755,7 +1755,14 @@ class SystemJobTemplateLaunch(GenericAPIView):
|
||||
if not request.user.can_access(self.model, 'start', obj):
|
||||
raise PermissionDenied()
|
||||
new_job = obj.create_unified_job()
|
||||
result = new_job.signal_start()
|
||||
if 'extra_vars' in request.DATA:
|
||||
try:
|
||||
extra_vars = json.loads(request.DATA['extra_vars'])
|
||||
except Exception:
|
||||
extra_vars = {}
|
||||
else:
|
||||
extra_vars = {}
|
||||
result = new_job.signal_start(**extra_vars)
|
||||
data = dict(system_job=new_job.id)
|
||||
return Response(data, status=status.HTTP_202_ACCEPTED)
|
||||
|
||||
|
@ -1168,7 +1168,7 @@ class RunSystemJob(BaseTask):
|
||||
if 'inventory_updates' in json_vars and json_vars['inventory_updates']:
|
||||
args.extend(['--inventory-updates'])
|
||||
except Exception, e:
|
||||
pass
|
||||
logger.error("Failed to parse system job: " + str(e))
|
||||
return args
|
||||
|
||||
def build_cwd(self, instance, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user