lint: maintenance chore

- reverted previours workarounds
- assures we run ansible-lint on our files
- bumped linters
- fixed new problems found by the linters

Change-Id: I7812fcfd17569b0c438f58bec73ab0f4b07e625c
This commit is contained in:
Sorin Sbarnea 2019-10-31 19:34:41 +00:00
parent 517f746249
commit 7b84c23443
23 changed files with 31 additions and 38 deletions

View File

@ -1,8 +1,9 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v2.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
@ -14,23 +15,28 @@ repos:
files: .*\.(yaml|yml)$
# commented to allow progressive adoption in smaller patches
# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.13.0
# rev: v1.18.0
# hooks:
# - id: yamllint
# files: \.(yaml|yml)$
# types: [file, yaml]
# entry: yamllint --strict -f parsable
- repo: https://github.com/ansible/ansible-lint
rev: v4.1.1a0
- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.1a5
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
entry: ansible-lint --force-color -v
always_run: true
pass_filenames: false
# do not add file filters here as ansible-lint does not give reliable
# results when called with individual files.
# https://github.com/ansible/ansible-lint/issues/611
verbose: true
entry: env ANSIBLE_LIBRARY=./library ansible-lint --force-color -p -v
- repo: https://github.com/openstack-dev/bashate.git
rev: 0.6.0
hooks:
- id: bashate
entry: bashate --error . --verbose --ignore=E006,E040
entry: bashate --error . --ignore=E006,E040
# Run bashate check for all bash scripts
# Ignores the following rules:
# E006: Line longer than 79 columns (as many scripts use jinja

View File

@ -2,4 +2,4 @@ pbr
# required to run scripts/tripleo-jobs.py
sqlalchemy
jenkinsapi
colorama
colorama

View File

@ -27,6 +27,7 @@
gzip -r "{{ workspace }}/logs" "{{ workspace }}/conf" "{{ workspace }}/etc"
chmod -R a+r "{{ workspace }}"
chown -R {{ ansible_user }}: "{{ workspace }}"
changed_when: true
- name: Rename compressed text based files to end with txt.gz extension
become: true
@ -37,6 +38,7 @@
{ new=orig; sub(/\.gz$/, ".txt.gz", new); system("mv " orig " " new) }
/\.(conf|ini|json|sh|log|yaml|yml|repo|cfg|j2|py)\.gz$/ { rename($0) }
/(\/logs\/|\/etc\/)[^ \/\.]+\.gz$/ { rename($0) }';
changed_when: true
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
no_log: true

View File

@ -8,3 +8,4 @@
- "{{ container_cli }} push {{ container_cli_opt }} {{ image }}:{{ version_hash }}_{{ ansible_architecture }}"
loop_control:
loop_var: "cmd"
changed_when: true

View File

@ -2,4 +2,3 @@ FROM trunk.registry.rdoproject.org/rhel/rhel8-rhui:8.0-126
RUN rm -f /etc/yum.repos.d/delorean*
COPY repos/delorean* /etc/yum.repos.d/
RUN dnf clean all

View File

@ -51,7 +51,7 @@
mode: u=rwx
- name: Fix shebang path for python3
shell: bash {{ workspace }}/pathfix_repos.sh
command: bash {{ workspace }}/pathfix_repos.sh
- name: pip install tripleo items
become: true

View File

@ -31,7 +31,7 @@
- 'tempest_cloud_name'
fail:
msg: "ERROR: {{ item }} is not overridable."
when: item not in "{{ allowed_overrides }}"
when: item not in allowed_overrides
with_items: "{{ featureset_override }}"
- name: Generate standalone_custom_env_files from standalone_environment_files
set_fact:
@ -46,7 +46,7 @@
when: featureset_override['standalone_environment_files'] is defined
- include_role:
name: ceph-loop-device
when: "{{ standalone_ceph|default(false) }}"
when: standalone_ceph is defined and standalone_ceph
- name: Generate featureset overriding file
template:
src: templates/featureset-override.j2
@ -102,7 +102,8 @@
force: yes
when: ready_releases_file is defined
- shell:
- name: run toci_gate_test.sh
shell:
cmd: |
set -e
set -x
@ -139,3 +140,4 @@
executable: /bin/bash
chdir: '{{ tripleo_root }}'
environment: '{{ zuul | zuul_legacy_vars }}'
changed_when: true

View File

@ -1,2 +1,2 @@
---
# handlers file for tripleo-repos
# handlers file for tripleo-repos

View File

@ -1,2 +1 @@
localhost

View File

@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- tripleo-repos
- tripleo-repos

View File

@ -1,2 +1,2 @@
---
# vars file for tripleo-repos
# vars file for tripleo-repos

View File

@ -14,4 +14,3 @@ neutron subnet-delete private_subnet
neutron net-delete private
neutron subnet-delete public_subnet
neutron net-delete public

View File

@ -19,4 +19,3 @@ service {"squid":
ensure => "running",
enable => true,
}

View File

@ -3,4 +3,3 @@ Description=Geard deamon
[Service]
ExecStart=/bin/geard -d --keepalive --keepalive-idle 1200 --keepalive-interval 60 --keepalive-count 10

View File

@ -25,4 +25,3 @@ service{"geard":
ensure => "running",
enable => true,
}

View File

@ -11,4 +11,3 @@ BASEPATH=$(realpath $(dirname $0))
cp $BASEPATH/geard.service /lib/systemd/system/geard.service
cp $BASEPATH/te_workers.service /lib/systemd/system/te_workers.service

View File

@ -3,4 +3,3 @@ Description=TE Workers
[Service]
ExecStart=/opt/stack/tripleo-ci/scripts/te-broker/start_workers.sh

View File

@ -23,4 +23,3 @@ parameter_defaults:
FQ2CFh3O5w14mJaKJZPuOM8g8q/PVHSZkMO7A+2BoxDKjF/P2fPvGPQSV3AoYleu
72dAUied9SXghzgyx5BYCJTwRL9poSG39okq+/zl4c+JVyFxweamlSI=
-----END CERTIFICATE-----

View File

@ -82,4 +82,3 @@ parameter_defaults:
- 172.18.0.248
storage_mgmt:
- 172.19.0.248

View File

@ -726,4 +726,4 @@ sVname
p356
Vbr-tenant
p357
sass.
sass.

View File

@ -668,4 +668,4 @@ sVname
p327
Vnic5
p328
sass.
sass.

View File

@ -7,4 +7,4 @@ mock
requests
pprint
pre-commit>=1.10 # MIT License
PyYAML
PyYAML

12
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
# keep py3 before py2 to assure they are preffered for envs like linters:
envlist = linters,py{37,36,35,27},mol
envlist = linters,py{37,36,35,27}
minversion = 3.4.0
ignore_basepython_conflict = True
skip_missing_interpreters = True
@ -42,18 +42,10 @@ commands = {posargs}
[testenv:linters]
deps =
# workaround for https://github.com/ansible/ansible-lint/issues/590
virtualenv==16.3.0 # 16.7.6 not working
pre-commit
pre-commit>=1.20.0
commands =
python -m pre_commit run -a
# deprecated: use linters instead. kept only as a convenience alias
[testenv:pep8]
envdir = {toxworkdir}/linters
whitelist_externals = {[testenv]whitelist_externals}
commands = {[testenv:linters]commands}
[testenv:cireport]
commands = python scripts/tripleo-jobs-gerrit.py {posargs}