Browse Source

Fixed linting

Basically backporting a series of changes from main.

Change-Id: Ia23170115f57f70a8ee5c1a3b34686fb53aa47dd
Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com>
Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
changes/32/747832/13
Chandan Kumar (raukadah) 1 month ago
parent
commit
bd6fb6d166
24 changed files with 38 additions and 57 deletions
  1. +3
    -0
      .ansible-lint
  2. +4
    -4
      .pre-commit-config.yaml
  3. +0
    -1
      LICENSE
  4. +0
    -1
      _skeleton_role_/defaults/main.yml.j2
  5. +0
    -1
      _skeleton_role_/meta/main.yml.j2
  6. +0
    -1
      _skeleton_role_/molecule/default/Dockerfile.j2
  7. +0
    -1
      _skeleton_role_/molecule/default/playbook.yml.j2
  8. +0
    -1
      doc/source/roles/role-backup-and-restore.rst
  9. +1
    -1
      setup.cfg
  10. +0
    -1
      test-requirements.txt
  11. +16
    -33
      tox.ini
  12. +1
    -1
      tripleo_ansible/roles/aide/molecule/default/Dockerfile
  13. +0
    -1
      tripleo_ansible/roles/octavia-controller-config/templates/ifcfg.j2
  14. +1
    -1
      tripleo_ansible/roles/test_package_action/molecule/default/Dockerfile
  15. +1
    -1
      tripleo_ansible/roles/test_package_action/molecule/negative/Dockerfile
  16. +1
    -1
      tripleo_ansible/roles/test_package_action/molecule/positive/Dockerfile
  17. +1
    -1
      tripleo_ansible/roles/tripleo-image-serve/molecule/default/Dockerfile
  18. +1
    -1
      tripleo_ansible/roles/tripleo-image-serve/molecule/legacy_vars/Dockerfile
  19. +1
    -1
      tripleo_ansible/roles/tripleo-keystone-resources/molecule/default/Dockerfile
  20. +1
    -1
      tripleo_ansible/roles/tripleo-nova-image-cache/molecule/default/Dockerfile
  21. +4
    -0
      tripleo_ansible/roles/tripleo-nova-image-cache/molecule/default/molecule.yml
  22. +0
    -1
      tripleo_ansible/roles/tripleo-systemd-wrapper/templates/service_sync.j2
  23. +1
    -1
      tripleo_ansible/roles/tuned/molecule/default/Dockerfile
  24. +1
    -1
      tripleo_ansible/roles/tuned/molecule/isolated/Dockerfile

+ 3
- 0
.ansible-lint View File

@@ -0,0 +1,3 @@
skip_list:
- '106' # Role name {} does not match ``^[a-z][a-z0-9_]+$`` pattern'
- '208' # File permissions not mentioned'

+ 4
- 4
.pre-commit-config.yaml View File

@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
rev: v3.2.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
@@ -18,14 +18,14 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.15.0
rev: v1.24.2
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict -f parsable
- repo: https://github.com/ansible/ansible-lint
rev: v4.1.1a2
rev: v4.3.1
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
@@ -36,7 +36,7 @@ repos:
# Things found within roles.galaxy are external
# and not something maintained here.
- repo: https://github.com/openstack-dev/bashate.git
rev: 0.6.0
rev: 2.0.0
hooks:
- id: bashate
entry: bashate --error . --verbose --ignore=E006,E040


+ 0
- 1
LICENSE View File

@@ -173,4 +173,3 @@
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.


+ 0
- 1
_skeleton_role_/defaults/main.yml.j2 View File

@@ -19,4 +19,3 @@

# All variables within this role should have a prefix of "tripleo_{{ role_name | replace('-', '_') }}"
tripleo_{{ role_name | replace('-', '_') }}_debug: false


+ 0
- 1
_skeleton_role_/meta/main.yml.j2 View File

@@ -42,4 +42,3 @@ galaxy_info:
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []


+ 0
- 1
_skeleton_role_/molecule/default/Dockerfile.j2 View File

@@ -35,4 +35,3 @@ RUN easy_install {{ pkg }}
{% endraw %}

CMD ["sh", "-c", "while true; do sleep 10000; done"]


+ 0
- 1
_skeleton_role_/molecule/default/playbook.yml.j2 View File

@@ -19,4 +19,3 @@
hosts: all
roles:
- role: "{{ role_name }}"


+ 0
- 1
doc/source/roles/role-backup-and-restore.rst View File

@@ -136,4 +136,3 @@ Lastly, we execute the actual backup step. With or without ceph.
--become-user root \
--tags bar_create_recover_image \
~/bar_rear_create_restore_images.yaml


+ 1
- 1
setup.cfg View File

@@ -31,4 +31,4 @@ universal = 1

[pbr]
skip_authors = True
skip_changelog = True
skip_changelog = True

+ 0
- 1
test-requirements.txt View File

@@ -1,4 +1,3 @@
pre-commit # MIT
netaddr # BSD
mock>=2.0.0 # BSD
stestr>=2.0.0 # Apache-2.0


+ 16
- 33
tox.ini View File

@@ -25,6 +25,8 @@ setenv =
# paramiko CryptographyDeprecationWarning: https://github.com/ansible/ansible/issues/52598
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command,ignore::UserWarning
PIP_DISABLE_PIP_VERSION_CHECK=1
linters: UPPER_CONSTRAINTS_FILE=/dev/null

sitepackages = True
deps =
-r {toxinidir}/test-requirements.txt
@@ -43,9 +45,14 @@ deps = bindep
commands = bindep test

[testenv:pep8]
setenv =
UPPER_CONSTRAINTS_FILE=file:///dev/null
envdir = {toxworkdir}/linters
deps =
{[testenv:linters]deps}
commands =
python -m pre_commit run flake8 -a
sitepackages = False

[testenv:ansible-lint]
envdir = {toxworkdir}/linters
@@ -56,42 +63,18 @@ commands =
ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml"
python -m pre_commit run ansible-lint -a

[testenv:yamllint]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run yamllint -a

[testenv:bashate]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run bashate -a

[testenv:whitespace]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run trailing-whitespace -a

[testenv:shebangs]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run check-executables-have-shebangs -a

[testenv:linters]
sitepackages = False
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/molecule-requirements.txt
pre-commit>=2.7.1 # MIT
virtualenv>=20.0.31
flake8
-r {toxinidir}/ansible-requirements.txt
commands =
{[testenv:pep8]commands}
{[testenv:ansible-lint]commands}
{[testenv:bashate]commands}
{[testenv:yamllint]commands}
{[testenv:whitespace]commands}
{[testenv:shebangs]commands}
pip check
bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/tripleo_ansible/roles.galaxy' \
ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml"
python -m pre_commit run -a
bash -c '{toxinidir}/scripts/detect-broken-symlinks.sh'

[testenv:releasenotes]


+ 1
- 1
tripleo_ansible/roles/aide/molecule/default/Dockerfile View File

@@ -34,4 +34,4 @@ RUN easy_install {{ pkg }}
{% endfor %}


CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 0
- 1
tripleo_ansible/roles/octavia-controller-config/templates/ifcfg.j2 View File

@@ -16,4 +16,3 @@ OVS_EXTRA="-- set Interface {{ mgmt_port_dev }} external-ids:iface-status=active
-- set Interface {{ mgmt_port_dev }} external-ids:skip_cleanup=true \
-- set Interface {{ mgmt_port_dev }} mac=\"{{ mgmt_port_mac }}\" \
-- set Interface {{ mgmt_port_dev }} other-config:hwaddr={{ mgmt_port_mac }}"


+ 1
- 1
tripleo_ansible/roles/test_package_action/molecule/default/Dockerfile View File

@@ -34,4 +34,4 @@ RUN easy_install {{ pkg }}
{% endfor %}


CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/test_package_action/molecule/negative/Dockerfile View File

@@ -34,4 +34,4 @@ RUN easy_install {{ pkg }}
{% endfor %}


CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/test_package_action/molecule/positive/Dockerfile View File

@@ -34,4 +34,4 @@ RUN easy_install {{ pkg }}
{% endfor %}


CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/tripleo-image-serve/molecule/default/Dockerfile View File

@@ -33,4 +33,4 @@ RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y pyth
RUN easy_install {{ pkg }}
{% endfor %}

CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/tripleo-image-serve/molecule/legacy_vars/Dockerfile View File

@@ -33,4 +33,4 @@ RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y pyth
RUN easy_install {{ pkg }}
{% endfor %}

CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/tripleo-keystone-resources/molecule/default/Dockerfile View File

@@ -34,4 +34,4 @@ RUN easy_install {{ pkg }}
{% endfor %}


CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/tripleo-nova-image-cache/molecule/default/Dockerfile View File

@@ -34,4 +34,4 @@ RUN easy_install {{ pkg }}
{% endfor %}


CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 4
- 0
tripleo_ansible/roles/tripleo-nova-image-cache/molecule/default/molecule.yml View File

@@ -10,6 +10,8 @@ platforms:
image: centos:7
dockerfile: Dockerfile
pkg_extras: python-setuptools
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
easy_install:
- pip
environment: &env
@@ -21,6 +23,8 @@ platforms:
image: centos:8
dockerfile: Dockerfile
pkg_extras: python*-setuptools
volumes:
- /etc/ci/mirror_info.sh:/etc/ci/mirror_info.sh:ro
environment:
<<: *env



+ 0
- 1
tripleo_ansible/roles/tripleo-systemd-wrapper/templates/service_sync.j2 View File

@@ -69,4 +69,3 @@ done
:> "$jobs_file"

flock -u "$lock_fd"


+ 1
- 1
tripleo_ansible/roles/tuned/molecule/default/Dockerfile View File

@@ -33,4 +33,4 @@ RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y pyth
RUN easy_install {{ pkg }}
{% endfor %}

CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

+ 1
- 1
tripleo_ansible/roles/tuned/molecule/isolated/Dockerfile View File

@@ -33,4 +33,4 @@ RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y pyth
RUN easy_install {{ pkg }}
{% endfor %}

CMD ["sh", "-c", "while true; do sleep 10000; done"]
CMD ["sh", "-c", "while true; do sleep 10000; done"]

Loading…
Cancel
Save