Linting hardening with pre-commit

- Adds bashate test using v0.6.0
- Bump pre-commit-hooks release to v2.2.4
- Bump ansible-lint release to v4.1.0a0
- Fix some minor flake8 errors

Change-Id: I66b796fab1d8651163226febbc4e99648a9ecc6a
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
(cherry picked from commit cac3e7101d)
This commit is contained in:
Gael Chamoulaud 2019-07-30 11:35:05 +02:00
parent 6f827f5ff8
commit 4d309d8e54
31 changed files with 273 additions and 143 deletions

View File

@ -1,8 +1,9 @@
--- ---
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0 rev: v2.1.0
hooks: hooks:
- id: end-of-file-fixer
- id: trailing-whitespace - id: trailing-whitespace
- id: mixed-line-ending - id: mixed-line-ending
- id: check-byte-order-marker - id: check-byte-order-marker
@ -10,20 +11,31 @@ repos:
- id: check-merge-conflict - id: check-merge-conflict
- id: debug-statements - id: debug-statements
- id: flake8 - id: flake8
additional_dependencies: entry: flake8 --ignore=E123,E125,W503,W504,W605
- hacking<1.2.0,>=1.1.0
- id: check-yaml - id: check-yaml
files: .*\.(yaml|yml)$ files: .*\.(yaml|yml)$
- repo: https://github.com/adrienverge/yamllint.git - repo: https://github.com/adrienverge/yamllint.git
rev: v1.13.0 rev: v1.15.0
hooks: hooks:
- id: yamllint - id: yamllint
files: \.(yaml|yml)$ files: \.(yaml|yml)$
types: [file, yaml] types: [file, yaml]
entry: yamllint --strict -f parsable entry: yamllint --strict -f parsable
- repo: https://github.com/ansible/ansible-lint - repo: https://github.com/ansible/ansible-lint
rev: v4.1.0 rev: v4.1.0a0
hooks: hooks:
- id: ansible-lint - id: ansible-lint
files: \.(yaml|yml)$ files: \.(yaml|yml)$
entry: ansible-lint --force-color -v entry: ansible-lint --force-color -v
- repo: https://github.com/openstack-dev/bashate.git
rev: 0.6.0
hooks:
- id: bashate
entry: bashate --error . --verbose --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
# templating, this is very difficult)
# E040: Syntax error determined using `bash -n` (as many scripts
# use jinja templating, this will often fail and the syntax
# error will be discovered in execution anyway)

33
bindep.txt Normal file
View File

@ -0,0 +1,33 @@
# This file facilitates OpenStack-CI package installation
# before the execution of any tests.
#
# See the following for details:
# - https://docs.openstack.org/infra/bindep/
# - https://opendev.org/opendev/bindep/
#
# Even if the role does not make use of this facility, it
# is better to have this file empty, otherwise OpenStack-CI
# will fall back to installing its default packages which
# will potentially be detrimental to the tests executed.
# The gcc compiler
gcc
# Base requirements for RPM distros
gcc-c++ [platform:rpm]
git [platform:rpm]
libffi-devel [platform:rpm]
openssl-devel [platform:rpm]
python-devel [platform:rpm]
python2-dnf [platform:fedora]
python-virtualenv [platform:rpm]
# For SELinux
libselinux-python [platform:rpm]
libsemanage-python [platform:redhat]
# Required for compressing collected log files in CI
gzip
# Required to build language docs
gettext

7
doc/requirements.txt Normal file
View File

@ -0,0 +1,7 @@
# this is required for the docs build jobs
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2;python_version>='3.4' # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
reno>=2.11.3 # Apache-2.0
doc8>=0.8.0 # Apache-2.0
bashate>=0.6.0 # Apache-2.0

View File

@ -58,10 +58,14 @@ def get_validation_parameters(validation):
def build_summary(group, validations): def build_summary(group, validations):
entries = ["* :ref:`{}`: {}".format(group + '_' + validation['id'], validation['name']) entries = [
for validation in validations] "* :ref:`{}`: {}".format(group + '_' + validation['id'],
validation['name'])
for validation in validations
]
with open('doc/source/validations-{}.rst'.format(group), 'w') as f: with open('doc/source/validations-{}.rst'.format(group), 'w') as f:
f.write("\n".join(entries)) f.write("\n".join(entries))
f.write("\n")
def format_dict(my_dict): def format_dict(my_dict):
@ -83,10 +87,11 @@ def build_detail(group, validations):
- **hosts**: {hosts} - **hosts**: {hosts}
- **groups**: {groups} - **groups**: {groups}
- **metadata**: {metadata} - **parameters**:{parameters}
- **parameters**: {parameters}
- **roles**: {roles} - **roles**: {roles}
Role documentation
.. toctree:: .. toctree::
roles/role-{roles} roles/role-{roles}

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -26,7 +27,7 @@ sys.path.insert(0, os.path.join(os.path.abspath('.'), '_exts'))
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [ extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.autodoc',
#'sphinx.ext.intersphinx', # 'sphinx.ext.intersphinx',
'generate_validations_doc', 'generate_validations_doc',
'ansible-autodoc', 'ansible-autodoc',
'openstackdocstheme' 'openstackdocstheme'

View File

@ -4,7 +4,7 @@
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to tripleo-validations's documentation! Welcome to tripleo-validations's documentation!
======================================================== ===============================================
Contents: Contents:
@ -13,7 +13,6 @@ Contents:
readme readme
installation installation
usage
contributing contributing
roles roles
modules modules
@ -38,4 +37,3 @@ Indices and tables
* :ref:`genindex` * :ref:`genindex`
* :ref:`search` * :ref:`search`

View File

@ -69,7 +69,7 @@ introspection.
Pre Deployment Pre Deployment
~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Validation that are run right before deploying the overcloud. Validations that are run right before deploying the overcloud.
.. include:: validations-pre-deployment.rst .. include:: validations-pre-deployment.rst
@ -94,6 +94,20 @@ Validations that are run right before a major upgrade of the undercloud or overc
.. include:: validations-pre-upgrade.rst .. include:: validations-pre-upgrade.rst
Post Upgrade
~~~~~~~~~~~~
Validations that are run right after a major upgrade of the undercloud or overcloud.
.. include:: validations-post-upgrade.rst
OpenShift On OpenStack
~~~~~~~~~~~~~~~~~~~~~~
Validations that are run right after the undercloud is installed.
.. include:: validations-openshift-on-openstack.rst
Writing Validations Writing Validations
------------------- -------------------

View File

@ -1,7 +0,0 @@
==========================
check-latest-minor-version
==========================
.. ansibleautoplugin::
:role: roles/check-latest-minor-version

View File

@ -0,0 +1,6 @@
=============================
check-latest-packages-version
=============================
.. ansibleautoplugin::
:role: roles/check-latest-packages-version

View File

@ -84,6 +84,7 @@ def _all_possible_names(arch, platform, image_name_base):
yield _name_helper(image_name_base, arch=arch) yield _name_helper(image_name_base, arch=arch)
yield _name_helper(image_name_base) yield _name_helper(image_name_base)
MISMATCH = ( MISMATCH = (
"\nNode {} has an incorrectly configured driver_info/deploy_{}. Expected " "\nNode {} has an incorrectly configured driver_info/deploy_{}. Expected "
"{} but got {}." "{} but got {}."
@ -182,5 +183,6 @@ def main():
else: else:
module.exit_json() module.exit_json()
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View File

@ -17,6 +17,10 @@
from __future__ import absolute_import from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
import itertools
from ansible.module_utils.basic import AnsibleModule
import six import six
six.add_metaclass(type) six.add_metaclass(type)
@ -114,10 +118,6 @@ docker:
type: list type: list
""" """
import itertools
from ansible.module_utils.basic import AnsibleModule
DOCKER_SUBCOMMAND_LOOKUP = [ DOCKER_SUBCOMMAND_LOOKUP = [
('images', 'images', '-q'), ('images', 'images', '-q'),
('volumes', 'volume ls', '-q'), ('volumes', 'volume ls', '-q'),

View File

@ -56,14 +56,14 @@ def generic_ini_style_conf_parser(file_path, section_regex, option_regex):
config[current_section] = {} config[current_section] = {}
match_option = re.match(option_regex, line) match_option = re.match(option_regex, line)
if match_option and current_section: if match_option and current_section:
option = re.sub('\s+', ' ', match_option.group(1)) option = re.sub(r'\s+', ' ', match_option.group(1))
config[current_section][option] = match_option.group(2) config[current_section][option] = match_option.group(2)
return config return config
def parse_haproxy_conf(file_path): def parse_haproxy_conf(file_path):
section_regex = '^(\w+)' section_regex = r'^(\w+)'
option_regex = '^(?:\s+)(\w+(?:\s+\w+)*?)\s+([\w/]*)$' option_regex = r'^(?:\s+)(\w+(?:\s+\w+)*?)\s+([\w/]*)$'
return generic_ini_style_conf_parser(file_path, section_regex, return generic_ini_style_conf_parser(file_path, section_regex,
option_regex) option_regex)

View File

@ -79,6 +79,7 @@ def get_result(path, section, key):
ret = ReturnValue.KEY_NOT_FOUND ret = ReturnValue.KEY_NOT_FOUND
return (ret, msg, value) return (ret, msg, value)
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: ini module: ini

View File

@ -15,6 +15,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from ansible.plugins.lookup import LookupBase
from tripleo_validations import utils
DOCUMENTATION = """ DOCUMENTATION = """
lookup: ironic_nodes lookup: ironic_nodes
description: Retrieve node information from Ironic description: Retrieve node information from Ironic
@ -65,10 +69,6 @@ _raw:
description: A Python list with results from the API call. description: A Python list with results from the API call.
""" """
from ansible.plugins.lookup import LookupBase
from tripleo_validations import utils
class LookupModule(LookupBase): class LookupModule(LookupBase):

View File

@ -15,6 +15,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from ansible.plugins.lookup import LookupBase
from novaclient.exceptions import NotFound
from tripleo_validations import utils
DOCUMENTATION = """ DOCUMENTATION = """
lookup: nova_servers lookup: nova_servers
description: Retrieve server information from Nova description: Retrieve server information from Nova
@ -51,11 +57,6 @@ _raw:
description: A Python list with results from the API call. description: A Python list with results from the API call.
""" """
from ansible.plugins.lookup import LookupBase
from novaclient.exceptions import NotFound
from tripleo_validations import utils
class LookupModule(LookupBase): class LookupModule(LookupBase):

10
molecule-requirements.txt Normal file
View File

@ -0,0 +1,10 @@
# this is required for the molecule jobs
ansible
ansi2html
docker
pytest
pytest-cov
pytest-html
pytest-xdist
mock
molecule>=2.22rc1

View File

@ -14,10 +14,8 @@
The nova-status upgrade check command has three standard return codes: The nova-status upgrade check command has three standard return codes:
0 -> All upgrade readiness checks passed successfully and there is nothing to do. 0 -> All upgrade readiness checks passed successfully and there is nothing to do.
1 -> At least one check encountered an issue and requires further investigation. 1 -> At least one check encountered an issue and requires further investigation. This is considered a warning but the upgrade may be OK.
This is considered a warning but the upgrade may be OK. 2 -> There was an upgrade status check failure that needs to be investigated. This should be considered something that stops an upgrade.
2 -> There was an upgrade status check failure that needs to be investigated.
This should be considered something that stops an upgrade.
groups: groups:
- pre-upgrade - pre-upgrade
roles: roles:

View File

@ -7,15 +7,10 @@
Check if there are enough resources for an OpenShift deployment on top Check if there are enough resources for an OpenShift deployment on top
of Openstack of Openstack
deployment: deployment:
- Is there a flavor that meets the minimum requirements for a test - Is there a flavor that meets the minimum requirements for a test environment? (4GB RAM, 40GB disk)
environment? - Is there a flavor that meets the minimum requirements for a production environment? (16GB RAM, 40GB disk, 4 VCPUs)
(4GB RAM, 40GB disk)
- Is there a flavor that meets the minimum requirements for a
production environment?
(16GB RAM, 40GB disk, 4 VCPUs)
- Are images named centos or rhel available? - Are images named centos or rhel available?
- Are there sufficient compute resources available for a default setup? - Are there sufficient compute resources available for a default setup? (1 Master node, 1 Infra node, 2 App nodes)
(1 Master node, 1 Infra node, 2 App nodes)
groups: groups:
- openshift-on-openstack - openshift-on-openstack
min_total_ram_testing: 16384 # 4 per node min_total_ram_testing: 16384 # 4 per node
@ -33,4 +28,4 @@
tasks: tasks:
- include_role: - include_role:
name: openshift-on-openstack name: openshift-on-openstack
tasks_from: openshift-hw-requirements tasks_from: openshift-hw-requirements.yaml

View File

@ -11,4 +11,4 @@
tasks: tasks:
- include_role: - include_role:
name: openshift-on-openstack name: openshift-on-openstack
tasks_from: openshift-nw-requirements tasks_from: openshift-nw-requirements.yaml

View File

@ -4,7 +4,7 @@
metadata: metadata:
name: Stack Health Check name: Stack Health Check
description: > description: >
Check if all stack resources are in a *_COMPLETE state before starting Check if all stack resources are in a 'COMPLETE' state before starting
an upgrade. an upgrade.
groups: groups:
- pre-upgrade - pre-upgrade

View File

@ -2,5 +2,5 @@
fixes: fixes:
- | - |
Instead of only outputting a warning, the IP range validation now fails if Instead of only outputting a warning, the IP range validation now fails if
the number of available addresses is lower than the recommended minimum. the number of available addresses is lower than the recommended minimum.
(Fixes https://bugs.launchpad.net/tripleo/+bug/1713483) (Fixes https://bugs.launchpad.net/tripleo/+bug/1713483)

View File

@ -132,14 +132,16 @@
warning_msg: | warning_msg: |
{{ lookup('template', './templates/openshift-hw-requirements-warnings.j2') }} {{ lookup('template', './templates/openshift-hw-requirements-warnings.j2') }}
- name: Fail if minimum requirements aren't met - name: Fail if minimum requirements are not met
fail: msg="{{ warning_msg }}" fail:
msg: "{{ warning_msg }}"
when: not matching_flavors_testing when: not matching_flavors_testing
or not matching_image or not matching_image
or not resource_reqs_testing or not resource_reqs_testing
- name: Warn if production requirements aren't met - name: Warn if production requirements are not met
warn: msg="{{ warning_msg }}" warn:
msg: "{{ warning_msg }}"
when: not matching_flavors_prod when: not matching_flavors_prod
or not matching_image or not matching_image
or not resource_reqs_prod or not resource_reqs_prod

View File

@ -15,3 +15,4 @@ testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT
reno>=2.5.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0
netaddr>=0.7.18 # BSD netaddr>=0.7.18 # BSD
pre-commit # MIT

View File

@ -11,8 +11,7 @@ BUILD_RESULT=$?
UNCOMMITTED_NOTES=$(git status --porcelain | \ UNCOMMITTED_NOTES=$(git status --porcelain | \
awk '$1 == "M" && $2 ~ /releasenotes\/notes/ {print $2}') awk '$1 == "M" && $2 ~ /releasenotes\/notes/ {print $2}')
if [ "${UNCOMMITTED_NOTES}" ] if [ "${UNCOMMITTED_NOTES}" ]; then
then
cat <<EOF cat <<EOF
REMINDER: The following changes to release notes have not been committed: REMINDER: The following changes to release notes have not been committed:

View File

@ -48,6 +48,7 @@ def parse_args():
return p.parse_args() return p.parse_args()
args = parse_args() args = parse_args()
path_args = args.path_args path_args = args.path_args
quiet = args.quiet quiet = args.quiet

160
tox.ini
View File

@ -1,82 +1,124 @@
[tox] [tox]
minversion = 3.8 minversion = 3.8
envlist = pep8,py35,py36,py27,molecule envlist = linters,docs,py27,py35,py36,molecule
skipsdist = True skipdist = True
[testenv] [testenv]
usedevelop = True usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages}
passenv = *
setenv = setenv =
ANSIBLE_FORCE_COLOR=1 ANSIBLE_NOCOWS=1
ANSIBLE_NOCOWS=1 ANSIBLE_RETRY_FILES_ENABLED=0
ANSIBLE_RETRY_FILES_ENABLED=0 ANSIBLE_STDOUT_CALLBACK=debug
ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_LOG_PATH={envlogdir}/ansible-execution.log
PY_COLORS=1 PY_COLORS=1
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
# pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207 # pip: Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
# paramiko CryptographyDeprecationWarning: https://github.com/ansible/ansible/issues/52598 # paramiko CryptographyDeprecationWarning: https://github.com/ansible/ansible/issues/52598
PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command,ignore::UserWarning PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command,ignore::UserWarning
PIP_DISABLE_PIP_VERSION_CHECK=1 PIP_DISABLE_PIP_VERSION_CHECK=1
passenv =
ANSIBLE_*
DOCKER_*
MOLECULE_*
PYTEST*
SSH_AUTH_SOCK
TERM
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt} {opts} {packages} "ansible>=2" "pre-commit>=1.10"
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}' commands = python setup.py test --slowest --testr-args='{posargs}'
sitepackages = True
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/molecule-requirements.txt
whitelist_externals = whitelist_externals =
bash bash
tox tox
[testenv:releasenotes] [testenv:bindep]
basepython = python3 # Do not install any requirements. We want this to be fast and work even if
whitelist_externals = bash # system dependencies are missing, since it's used to tell you what system
commands = bash -c tools/releasenotes_tox.sh # dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
[testenv:pep8] deps = bindep
basepython = python3 commands = bindep test
commands =
{[testenv:ansible-lint]commands}
flake8 {posargs}
python ./tools/validate-files.py .
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:cover]
basepython = python3
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
basepython = python3
commands = python setup.py build_sphinx
[testenv:debug] [testenv:debug]
basepython = python3 basepython = python3
commands = oslo_debug_helper {posargs} commands = oslo_debug_helper {posargs}
[testenv:pep8]
envdir = {toxworkdir}/linters
commands =
python -m pre_commit run flake8 -a
[testenv:ansible-lint] [testenv:ansible-lint]
basepython = python3 envdir = {toxworkdir}/linters
deps =
{[testenv:linters]deps}
commands = commands =
python -m pre_commit run ansible-lint -a python -m pre_commit run ansible-lint -a
[flake8] [testenv:yamllint]
# E123, E125 skipped as they are invalid PEP-8. envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run yamllint -a
show-source = True [testenv:bashate]
ignore = E123,E125 envdir = {toxworkdir}/linters
builtins = _ deps = {[testenv:linters]deps}
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build commands =
python -m pre_commit run bashate -a
[testenv:lower-constraints] [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]
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/molecule-requirements.txt
commands =
{[testenv:pep8]commands}
{[testenv:ansible-lint]commands}
{[testenv:bashate]commands}
{[testenv:whitespace]commands}
{[testenv:shebangs]commands}
# {[testenv:yamllint]commands}
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:cover]
basepython = python3 basepython = python3
deps = deps =
-c{toxinidir}/lower-constraints.txt -r {toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt -r {toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt -r {toxinidir}/molecule-requirements.txt
commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs]
basepython = python3
deps =
-r {toxinidir}/doc/requirements.txt
-r {toxinidir}/molecule-requirements.txt
commands=
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html -T
doc8 doc
[doc8]
# Settings for doc8:
extensions = .rst
ignore = D001
[testenv:venv]
commands = {posargs}
[testenv:molecule] [testenv:molecule]
basepython = python3 basepython = python3
@ -93,3 +135,11 @@ deps =
selinux selinux
commands = commands =
python -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} {posargs:roles} python -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html {tty:-s} {posargs:roles}
[testenv:lower-constraints]
basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
-r{toxinidir}/molecule-requirements.txt

View File

@ -17,6 +17,10 @@
from __future__ import absolute_import from __future__ import absolute_import
from __future__ import division from __future__ import division
from __future__ import print_function from __future__ import print_function
from ansible.module_utils.basic import AnsibleModule
import itertools
import six import six
six.add_metaclass(type) six.add_metaclass(type)
@ -114,10 +118,6 @@ docker:
type: list type: list
""" """
import itertools
from ansible.module_utils.basic import AnsibleModule
DOCKER_SUBCOMMAND_LOOKUP = [ DOCKER_SUBCOMMAND_LOOKUP = [
('images', 'images', '-q'), ('images', 'images', '-q'),
('volumes', 'volume ls', '-q'), ('volumes', 'volume ls', '-q'),

View File

@ -79,6 +79,7 @@ def get_result(path, section, key):
ret = ReturnValue.KEY_NOT_FOUND ret = ReturnValue.KEY_NOT_FOUND
return (ret, msg, value) return (ret, msg, value)
DOCUMENTATION = ''' DOCUMENTATION = '''
--- ---
module: ini module: ini

View File

@ -15,6 +15,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from ansible.plugins.lookup import LookupBase
from tripleo_validations import utils
DOCUMENTATION = """ DOCUMENTATION = """
lookup: ironic_nodes lookup: ironic_nodes
description: Retrieve node information from Ironic description: Retrieve node information from Ironic
@ -65,10 +68,6 @@ _raw:
description: A Python list with results from the API call. description: A Python list with results from the API call.
""" """
from ansible.plugins.lookup import LookupBase
from tripleo_validations import utils
class LookupModule(LookupBase): class LookupModule(LookupBase):

View File

@ -15,6 +15,11 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from ansible.plugins.lookup import LookupBase
from novaclient.exceptions import NotFound
from tripleo_validations import utils
DOCUMENTATION = """ DOCUMENTATION = """
lookup: nova_servers lookup: nova_servers
description: Retrieve server information from Nova description: Retrieve server information from Nova
@ -51,11 +56,6 @@ _raw:
description: A Python list with results from the API call. description: A Python list with results from the API call.
""" """
from ansible.plugins.lookup import LookupBase
from novaclient.exceptions import NotFound
from tripleo_validations import utils
class LookupModule(LookupBase): class LookupModule(LookupBase):

View File

@ -1,22 +1,23 @@
- project: - project:
templates: templates:
- tripleo-multinode-container-minimal - tripleo-multinode-container-minimal
- openstack-python-jobs - openstack-python-jobs
- openstack-python35-jobs - openstack-python35-jobs
- openstack-python36-jobs - openstack-python36-jobs
- openstack-tox-molecule - check-requirements
- check-requirements - publish-openstack-docs-pti
- publish-openstack-docs-pti - release-notes-jobs-python3
- release-notes-jobs-python3
check: check:
jobs: jobs:
- openstack-tox-lower-constraints - openstack-tox-linters
- tripleo-ci-centos-7-scenario004-standalone: - openstack-tox-lower-constraints
files: - tripleo-ci-centos-7-scenario004-standalone:
- ^roles/ceph.*$ files:
- ^roles/ceph.*$
gate: gate:
jobs: jobs:
- openstack-tox-lower-constraints - openstack-tox-linters
- tripleo-ci-centos-7-scenario004-standalone: - openstack-tox-lower-constraints
files: - tripleo-ci-centos-7-scenario004-standalone:
- ^roles/ceph.*$ files:
- ^roles/ceph.*$