Work in progress on inventory script using API.

This commit is contained in:
Chris Church
2013-06-20 04:20:48 -04:00
parent 65defb75fb
commit 59d1ae7322
17 changed files with 524 additions and 7 deletions

View File

@@ -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 = []