Lint YAML files

Currently most OpenStack code is linted, but YAML files are not. As a
result, sometimes YAML problems enter the code base (e.g., the key
duplicate fixed in change I7f2369adfb152fd2a74b9b105e969e653e592922).

This patch enables YAML linting in tox linting tests, using the
yamllint tool [1]. It checks syntax errors, key duplicates, and
cosmetic problems.

[1]: http://yamllint.readthedocs.org/

EDIT: It also fixes six errors (including key duplicates) that entered
the code base after the first fix change was merged.
(I7f2369adfb152fd2a74b9b105e969e653e592922)

Change-Id: Ie746230f28fe3ed0cf218201d5a3810f7bc44070
This commit is contained in:
Adrien Vergé 2016-02-04 19:07:41 +01:00
parent 46d01aac66
commit e9d9662bb6
8 changed files with 17 additions and 7 deletions

10
.yamllint Normal file
View File

@ -0,0 +1,10 @@
---
extends: default
rules:
braces: {min-spaces-inside: 0, max-spaces-inside: 1}
brackets: {min-spaces-inside: 0, max-spaces-inside: 1}
comments: disable
comments-indentation: disable
document-start: disable
indentation: disable
line-length: disable

View File

@ -34,4 +34,4 @@ outputs:
value: { get_attr: [container, secret_refs] }
consumers:
description: The URIs to container consumers.
value: { get_attr: [container, consumers] }
value: { get_attr: [container, consumers] }

View File

@ -65,4 +65,4 @@ outputs:
value: { get_attr: [order, order_ref] }
secret_ref:
description: The URI to the created secret.
value: { get_attr: [order, secret_ref] }
value: { get_attr: [order, secret_ref] }

View File

@ -69,9 +69,9 @@ outputs:
secret_status:
description: The status of the secret.
value: { get_attr: [secret, status] }
secret_status:
secret_payload:
description: The decrypted secret payload.
value: { get_attr: [secret, status] }
secret_ref:
description: Reference for created secret.
value: { get_resource: secret }
value: { get_resource: secret }

View File

@ -156,7 +156,6 @@ resources:
outputs:
lburl:
description: URL of the loadbalancer
value:
str_replace:
template: http://IP_ADDRESS:PORT

View File

@ -25,7 +25,7 @@ resources:
profile:
type: OS::Senlin::Profile
properties:
type: os.nova.server-1.0
type: os.nova.server-1.0
properties:
flavor: {get_param: flavor}
image: {get_param: image}
@ -93,4 +93,3 @@ outputs:
template: curl -X POST LINK
params:
LINK: {get_attr: [receiver_scale_in, channel, alarm_url]}

View File

@ -11,6 +11,7 @@ salt
testrepository>=0.0.18
testscenarios>=0.4
testtools>=0.9.34
yamllint>=1.2.0
python-heatclient>=1.2.0
python-keystoneclient>=0.10.0

View File

@ -12,6 +12,7 @@ commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
[testenv:pep8]
commands = flake8
yamllint .
[testenv:venv]
commands = {posargs}