Add project info to JobDirPlaybook

For later use in logging.

Change-Id: I98b37c135fa9641cbb4b3e6d42b34663dd78a423
This commit is contained in:
James E. Blair 2017-07-19 09:42:25 -07:00
parent 3e4a3b11a4
commit 210e218fea
1 changed files with 6 additions and 1 deletions

View File

@ -158,6 +158,8 @@ class JobDirPlaybook(object):
def __init__(self, root):
self.root = root
self.trusted = None
self.branch = None
self.canonical_name_and_path = None
self.path = None
self.roles = []
self.roles_path = []
@ -1065,10 +1067,13 @@ class AnsibleJob(object):
self.log.debug("Prepare playbook repo for %s" % (playbook,))
# Check out the playbook repo if needed and set the path to
# the playbook that should be run.
jobdir_playbook.trusted = playbook['trusted']
source = self.executor_server.connections.getSource(
playbook['connection'])
project = source.getProject(playbook['project'])
jobdir_playbook.trusted = playbook['trusted']
jobdir_playbook.branch = playbook['branch']
jobdir_playbook.canonical_name_and_path = os.path.join(
project.canonical_name, playbook['path'])
path = None
if not playbook['trusted']:
# This is a project repo, so it is safe to use the already