Merge "Remove ansible-role from implied role names" into feature/zuulv3

This commit is contained in:
Jenkins 2017-07-19 23:32:57 +00:00 committed by Gerrit Code Review
commit 3cc96087e9
1 changed files with 4 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import os
import logging
import textwrap
import io
import re
import voluptuous as vs
@ -300,6 +301,8 @@ class SecretParser(object):
class JobParser(object):
ANSIBLE_ROLE_RE = re.compile(r'^(ansible[-_.+]*)*(role[-_.+]*)*')
@staticmethod
def getSchema():
auth = {'secrets': to_list(str),
@ -563,6 +566,7 @@ class JobParser(object):
def _makeImplicitRole(job):
project = job.source_context.project
name = project.name.split('/')[-1]
name = JobParser.ANSIBLE_ROLE_RE.sub('', name)
return model.ZuulRole(name,
project.connection_name,
project.name,