mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
Work in progress on inventory script using API.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# All Rights Reserved.
|
||||
|
||||
# Python
|
||||
import hmac
|
||||
import json
|
||||
import os
|
||||
import shlex
|
||||
@@ -814,6 +815,13 @@ class Job(CommonModel):
|
||||
except TaskMeta.DoesNotExist:
|
||||
pass
|
||||
|
||||
@property
|
||||
def callback_auth_token(self):
|
||||
'''Return temporary auth token used for task callbacks via API.'''
|
||||
if self.status == 'running':
|
||||
h = hmac.new(settings.SECRET_KEY, self.created.isoformat())
|
||||
return '%d-%s' % (self.pk, h.hexdigest())
|
||||
|
||||
def get_passwords_needed_to_start(self):
|
||||
'''Return list of password field names needed to start the job.'''
|
||||
needed = []
|
||||
|
||||
Reference in New Issue
Block a user