Reduce git clone noise when zuul cloner is used

When zuul cloner is used, the git clone task skips all the
openstack repositories and generates a lot of log noise.

This patch filters the list prior to giving it to the task
so that the noise is reduced.

Change-Id: Ia51b6c0899611fe92c8232a252b07c985aef923d
This commit is contained in:
Jesse Pretorius 2017-04-24 13:02:11 +01:00 committed by Jesse Pretorius (odyssey4me)
parent a6c205c986
commit a4d33d74aa
1 changed files with 14 additions and 2 deletions

View File

@ -39,6 +39,19 @@
- item.scm == "git" or item.scm is undefined
with_items: "{{ roles }}"
- name: Prepare non-openstack git clone list
set_fact:
filtered_roles: >
{%- set filtered_role_list = [] %}
{%- for role in roles %}
{%- if not role.src | match(".*git.openstack.org.*") %}
{%- set _ = filtered_role_list.append(role) %}
{%- endif %}
{%- endfor %}
{{- filtered_role_list -}}
when:
- _zuul_cloner_check.rc == 0
- name: Clone git repos (with git)
git:
repo: "{{ item.src }}"
@ -47,9 +60,8 @@
update: true
force: true
when:
- (_zuul_cloner_check.rc != 0) or (not item.src | match(".*git.openstack.org.*"))
- item.scm == "git" or item.scm is undefined
with_items: "{{ roles }}"
with_items: "{{ filtered_roles | default(roles) }}"
- name: Create clone map
copy: