tripleo-heat-templates/tools
Ben Nemec f572b764f1 Add validation check for divergent parameter definitions
Many of our parameters are defined in multiple templates, but
currently there is no easy way of checking that all of those
definitions match.  It can be confusing when a parameter is defined
one way in one file and another way in a different file.  For example,
the NovaWorkers description is:

Number of workers for Nova API service.

and

Number of workers for Nova Placement API service.

and

Number of workers for Nova Conductor service.

Which is it actually?  All of them.  That one parameter controls
the workers for all of the nova services, and its description should
reflect that, no matter which template you happen to look at.

This change adds a check to yaml-validate.py to catch these sorts of
inconsistencies and allow us to eventually prevent new ones from
getting into the templates.

An exclusion mechanism is included because there are some parameter
definitions we probably can't/shouldn't change.  In particular, this
includes the network cidrs which are defaulted to ipv4 addresses in
the ipv4 net-iso templates and ipv6 in the ipv6 templates.  It's
possible a user would be relying on one of those defaults in their
configuration, so if we change it they might break.

To get around that, the tool explicitly ignores the default field of
those parameters, while still checking the description and type fields
so we maintain some sanity.  There may be other parameters where this
is an issue, but those can be added later as they are found.

For the moment any inconsistencies are soft-fails.  A failure message
will be printed, but the return value will not be affected so we can
add the tool without first having to fix every divergent parameter
definition in tripleo-heat-templates (and there appear to be plenty).
This will allow us to gradually fix the parameters over time, and
once that is done we can make this a hard-fail.

Change-Id: Ib8b2cb5e610022d2bbcec9f2e2d30d9a7c2be511
Partial-Bug: 1700664
2017-06-27 11:26:01 -05:00
..
process-templates.py Add network_data.yaml to encapsulate list of networks for j2 2017-03-05 03:20:42 +00:00
releasenotes_tox.sh Add ReNo support 2017-01-13 14:35:27 -05:00
tox_install.sh Add ReNo support 2017-01-13 14:35:27 -05:00
yaml-nic-config-2-script.py Replace six.iteritems() with .items() 2017-04-07 15:23:50 +08:00
yaml-validate.py Add validation check for divergent parameter definitions 2017-06-27 11:26:01 -05:00