Add dib-lint to pep8 tox job

dib-lint can catch some common errors in elements, so it would be
good to run it on instack-undercloud.  For the moment I'm just
ignoring failures that would require invasive changes to the
existing code, but it might be good to actually fix those at some
point.

Change-Id: Iaa522a888806fd9a58eafa30a3cf7d5aac01a45e
Depends-On: Id4b167ed220dd55852b6587b884fabe7bc8554eb
This commit is contained in:
Ben Nemec 2016-04-15 15:52:24 +00:00
parent 4700960f23
commit 0be2088102
6 changed files with 30 additions and 16 deletions

View File

@ -1,3 +1,3 @@
vm
local-config
package-installs
vm

View File

@ -15,7 +15,6 @@
# under the License.
import os
import shutil
import subprocess
import tempfile

View File

@ -100,13 +100,13 @@ rm -rf $HOME/.novaclient
# load workflows
for workbook in $(mistral workbook-list | grep tripleo | cut -f 2 -d ' '); do
mistral workbook-delete $workbook
mistral workbook-delete $workbook
done
for workflow in $(mistral workflow-list | grep tripleo | cut -f 2 -d ' '); do
mistral workflow-delete $workflow
mistral workflow-delete $workflow
done
for workbook in $(ls /usr/share/tripleo-common/workflows/*); do
mistral workbook-create $workbook
mistral workbook-create $workbook
done
# restart openstack-nova-compute

View File

@ -26,7 +26,8 @@ template = os.path.join(os.path.dirname(__file__),
context = {
'LOCAL_IP': os.environ.get('LOCAL_IP', '192.0.2.1'),
'PUBLIC_INTERFACE_IP': os.environ.get('PUBLIC_INTERFACE_IP', '192.0.2.1/24'),
'PUBLIC_INTERFACE_IP':
os.environ.get('PUBLIC_INTERFACE_IP', '192.0.2.1/24'),
'LOCAL_INTERFACE': os.environ.get('LOCAL_INTERFACE', 'eth1'),
'LOCAL_MTU': os.environ.get('LOCAL_MTU', 1500),
'MASQUERADE_NETWORK': os.environ.get('MASQUERADE_NETWORK', '192.0.2.0/24'),
@ -34,11 +35,15 @@ context = {
'DHCP_END': os.environ.get('DHCP_END', '192.0.2.24'),
'NETWORK_CIDR': os.environ.get('NETWORK_CIDR', '192.0.2.0/24'),
'NETWORK_GATEWAY': os.environ.get('NETWORK_GATEWAY', '192.0.2.1'),
'DISCOVERY_INTERFACE': os.environ.get('DISCOVERY_INTERFACE', 'br-ctlplane'),
'DISCOVERY_IPRANGE': os.environ.get('DISCOVERY_IPRANGE', '192.0.2.100,192.0.2.120'),
'DISCOVERY_INTERFACE':
os.environ.get('DISCOVERY_INTERFACE', 'br-ctlplane'),
'DISCOVERY_IPRANGE':
os.environ.get('DISCOVERY_IPRANGE', '192.0.2.100,192.0.2.120'),
'DISCOVERY_RUNBENCH': os.environ.get('DISCOVERY_RUNBENCH', '0'),
'UNDERCLOUD_IRONIC_PASSWORD': os.environ.get('UNDERCLOUD_IRONIC_PASSWORD', 'unset'),
'UNDERCLOUD_SERVICE_CERTIFICATE': os.environ.get('UNDERCLOUD_SERVICE_CERTIFICATE', ''),
'UNDERCLOUD_IRONIC_PASSWORD':
os.environ.get('UNDERCLOUD_IRONIC_PASSWORD', 'unset'),
'UNDERCLOUD_SERVICE_CERTIFICATE':
os.environ.get('UNDERCLOUD_SERVICE_CERTIFICATE', ''),
'UNDERCLOUD_PUBLIC_VIP': os.environ.get('UNDERCLOUD_PUBLIC_VIP', ''),
'UNDERCLOUD_ADMIN_VIP': os.environ.get('UNDERCLOUD_ADMIN_VIP', ''),
'HIERADATA_OVERRIDE': hiera_entry,

View File

@ -2,10 +2,10 @@
set -eux
if systemctl is-enabled keepalived; then
# This needs to be run after os-net-config, since os-net-config potentially
# can restart network interfaces, which would affects VIPs controlled by
# keepalived. So don't just move this up without knowing the consequences.
# You have been warned.
systemctl reload keepalived
# This needs to be run after os-net-config, since os-net-config potentially
# can restart network interfaces, which would affects VIPs controlled by
# keepalived. So don't just move this up without knowing the consequences.
# You have been warned.
systemctl reload keepalived
fi

12
tox.ini
View File

@ -19,11 +19,13 @@ commands = python setup.py build_sphinx
[testenv:pep8]
deps = bashate
flake8
diskimage-builder
whitelist_externals =
bash
commands =
flake8
bash -c "find scripts -type f | xargs bashate -v -iE006"
dib-lint
[testenv:cover]
commands = python setup.py test --coverage --coverage-package-name=instack_undercloud --testr-args='{posargs}'
@ -31,7 +33,15 @@ commands = python setup.py test --coverage --coverage-package-name=instack_under
[flake8]
ignore = H803
show-source = True
exclude = .tox,dist,doc,*.egg,build
# puppet-stack-config horribly violates E501 (line length), but I'm not
# bothered enough to spend the time to fix it.
exclude = .tox,dist,doc,*.egg,build,elements/puppet-stack-config/install.d/02-puppet-stack-config
[dib-lint]
# NOTE(bnemec): I mostly want the executable check from dib-lint, so at least
# for the moment I'm ignoring any failures that would require more than simple
# reformatting of files.
ignore = dibdebugtrace sete setu setpipefail mddocs
[testenv:genconfig]
commands = oslo-config-generator --config-file config-generator/undercloud.conf