Fix pep8 for config_template.py
Gate tests will fail until we fix pep8 for config_template.py This PR fixes the config_template module for pep8 compliance, follows the latest PTI for docs compliance, and re-enables the linters. Change-Id: Ic288b462a53ac45983f47f29a7d5d8d48d0b9c0b Co-Authored-By: Jean-Philippe Evrard <jean-philippe@evrard.me>
This commit is contained in:
parent
e4c63074c6
commit
2c6ebef2a4
@ -16,13 +16,11 @@
|
|||||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import configparser as ConfigParser
|
import configparser as ConfigParser
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
try:
|
try:
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
@ -35,14 +33,14 @@ import re
|
|||||||
import time
|
import time
|
||||||
import yaml
|
import yaml
|
||||||
import tempfile as tmpfilelib
|
import tempfile as tmpfilelib
|
||||||
|
|
||||||
|
|
||||||
from ansible.plugins.action import ActionBase
|
from ansible.plugins.action import ActionBase
|
||||||
from ansible.module_utils._text import to_bytes, to_text
|
from ansible.module_utils._text import to_bytes, to_text
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
from ansible import errors
|
from ansible import errors
|
||||||
from ansible.parsing.yaml.dumper import AnsibleDumper
|
from ansible.parsing.yaml.dumper import AnsibleDumper
|
||||||
|
|
||||||
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
CONFIG_TYPES = {
|
CONFIG_TYPES = {
|
||||||
'ini': 'return_config_overrides_ini',
|
'ini': 'return_config_overrides_ini',
|
||||||
@ -427,7 +425,8 @@ class ActionModule(ActionBase):
|
|||||||
new_items=value,
|
new_items=value,
|
||||||
list_extend=list_extend
|
list_extend=list_extend
|
||||||
)
|
)
|
||||||
elif not isinstance(value, int) and (',' in value or '\n' in value):
|
elif (not isinstance(value, int) and
|
||||||
|
(',' in value or '\n' in value)):
|
||||||
base_items[key] = re.split(',|\n', value)
|
base_items[key] = re.split(',|\n', value)
|
||||||
base_items[key] = [i.strip() for i in base_items[key] if i]
|
base_items[key] = [i.strip() for i in base_items[key] if i]
|
||||||
elif isinstance(value, list):
|
elif isinstance(value, list):
|
||||||
|
10
doc/requirements.txt
Normal file
10
doc/requirements.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# The order of packages is significant, because pip processes them in the order
|
||||||
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
|
# process, which may cause wedges in the gate later.
|
||||||
|
|
||||||
|
# this is required for the docs build jobs
|
||||||
|
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
|
||||||
|
openstackdocstheme>=1.18.1 # Apache-2.0
|
||||||
|
reno>=2.5.0 # Apache-2.0
|
||||||
|
sphinxmark>=0.1.14 # Apache-2.0
|
||||||
|
doc8>=0.6.0 # Apache-2.0
|
@ -52,7 +52,7 @@ master_doc = 'index'
|
|||||||
author = 'OpenStack-Ansible Contributors'
|
author = 'OpenStack-Ansible Contributors'
|
||||||
category = 'Miscellaneous'
|
category = 'Miscellaneous'
|
||||||
copyright = '2014-2018, OpenStack-Ansible Contributors'
|
copyright = '2014-2018, OpenStack-Ansible Contributors'
|
||||||
description = 'Config Template allow flexible .yaml, .ini, .json modifications.'
|
description = 'Config Template allow flexible .yaml, .ini, .json modification.'
|
||||||
project = 'Config Template'
|
project = 'Config Template'
|
||||||
target_name = 'ansible-config_template'
|
target_name = 'ansible-config_template'
|
||||||
title = 'Config Template Documentation'
|
title = 'Config Template Documentation'
|
||||||
|
@ -221,7 +221,8 @@ latex_elements = {
|
|||||||
# (source start file, target name, title,
|
# (source start file, target name, title,
|
||||||
# author, documentclass [howto, manual, or own class]).
|
# author, documentclass [howto, manual, or own class]).
|
||||||
latex_documents = [
|
latex_documents = [
|
||||||
('index', 'OpenStackAnsibleReleaseNotes.tex', u'OpenStack-Ansible Release Notes Documentation',
|
('index', 'OpenStackAnsibleReleaseNotes.tex',
|
||||||
|
u'OpenStack-Ansible Release Notes Documentation',
|
||||||
u'OpenStack-Ansible Developers', 'manual'),
|
u'OpenStack-Ansible Developers', 'manual'),
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -251,7 +252,8 @@ latex_documents = [
|
|||||||
# One entry per manual page. List of tuples
|
# One entry per manual page. List of tuples
|
||||||
# (source start file, name, description, authors, manual section).
|
# (source start file, name, description, authors, manual section).
|
||||||
man_pages = [
|
man_pages = [
|
||||||
('index', 'openstackansiblereleasenotes', u'OpenStack-Ansible Release Notes Documentation',
|
('index', 'openstackansiblereleasenotes',
|
||||||
|
u'OpenStack-Ansible Release Notes Documentation',
|
||||||
[u'OpenStack-Ansible Developers'], 1)
|
[u'OpenStack-Ansible Developers'], 1)
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -265,7 +267,8 @@ man_pages = [
|
|||||||
# (source start file, target name, title, author,
|
# (source start file, target name, title, author,
|
||||||
# dir menu entry, description, category)
|
# dir menu entry, description, category)
|
||||||
texinfo_documents = [
|
texinfo_documents = [
|
||||||
('index', 'OpenStackAnsibleReleaseNotes', u'OpenStack-Ansible Release Notes Documentation',
|
('index', 'OpenStackAnsibleReleaseNotes',
|
||||||
|
u'OpenStack-Ansible Release Notes Documentation',
|
||||||
u'OpenStack-Ansible Developers', 'OpenStackAnsibleReleaseNotes',
|
u'OpenStack-Ansible Developers', 'OpenStackAnsibleReleaseNotes',
|
||||||
'One line description of project.',
|
'One line description of project.',
|
||||||
'Miscellaneous'),
|
'Miscellaneous'),
|
||||||
|
@ -6,8 +6,3 @@
|
|||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
|
||||||
unreleased
|
unreleased
|
||||||
queens
|
|
||||||
pike
|
|
||||||
ocata
|
|
||||||
newton
|
|
||||||
mitaka
|
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
=============================
|
|
||||||
Mitaka Series Release Notes
|
|
||||||
=============================
|
|
||||||
|
|
||||||
.. release-notes::
|
|
||||||
:branch: origin/stable/mitaka
|
|
@ -1,6 +0,0 @@
|
|||||||
===================================
|
|
||||||
Newton Series Release Notes
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. release-notes::
|
|
||||||
:branch: origin/stable/newton
|
|
@ -1,6 +0,0 @@
|
|||||||
===================================
|
|
||||||
Ocata Series Release Notes
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. release-notes::
|
|
||||||
:branch: origin/stable/ocata
|
|
@ -1,6 +0,0 @@
|
|||||||
===================================
|
|
||||||
Pike Series Release Notes
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. release-notes::
|
|
||||||
:branch: stable/pike
|
|
@ -1,6 +0,0 @@
|
|||||||
===================================
|
|
||||||
Queens Series Release Notes
|
|
||||||
===================================
|
|
||||||
|
|
||||||
.. release-notes::
|
|
||||||
:branch: stable/queens
|
|
4
tox.ini
4
tox.ini
@ -37,10 +37,11 @@ setenv =
|
|||||||
|
|
||||||
|
|
||||||
[testenv:docs]
|
[testenv:docs]
|
||||||
|
deps = -r{toxinidir}/doc/requirements.txt
|
||||||
commands=
|
commands=
|
||||||
bash -c "rm -rf doc/build"
|
bash -c "rm -rf doc/build"
|
||||||
doc8 doc
|
doc8 doc
|
||||||
python setup.py build_sphinx
|
sphinx-build -b html doc/source doc/build/html
|
||||||
|
|
||||||
|
|
||||||
[doc8]
|
[doc8]
|
||||||
@ -49,6 +50,7 @@ extensions = .rst
|
|||||||
|
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
|
deps = -r{toxinidir}/doc/requirements.txt
|
||||||
commands =
|
commands =
|
||||||
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
#- openstack-ansible-linters
|
- openstack-ansible-linters
|
||||||
- openstack-ansible-functional-centos-7
|
- openstack-ansible-functional-centos-7
|
||||||
- openstack-ansible-functional-opensuse-423
|
- openstack-ansible-functional-opensuse-423
|
||||||
- openstack-ansible-functional-ubuntu-xenial
|
- openstack-ansible-functional-ubuntu-xenial
|
||||||
@ -25,7 +25,7 @@
|
|||||||
- openstack-ansible-integrated-deploy-aio
|
- openstack-ansible-integrated-deploy-aio
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
#- openstack-ansible-linters
|
- openstack-ansible-linters
|
||||||
- openstack-ansible-functional-centos-7
|
- openstack-ansible-functional-centos-7
|
||||||
- openstack-ansible-functional-opensuse-423
|
- openstack-ansible-functional-opensuse-423
|
||||||
- openstack-ansible-functional-ubuntu-xenial
|
- openstack-ansible-functional-ubuntu-xenial
|
||||||
|
Loading…
x
Reference in New Issue
Block a user