Gage Hugo a4a8f46248 Make is_valid more flexible with uuid validation
In keystone, multiple domain ids are handled by concatenating
two valid uuids together. This causes issues with pycadf validation
and causes the following warning to be thrown:

warnings.warn('Invalid uuid. To ensure interoperability, identifiers '
'should be a valid uuid.')

This appears throughout the testing logs while running keystone tests
and there is a current attempt to remove most/all invalid uuids to
eliminate this warning [0]. However due to the multiple domain id
issue, this cannot be solved in keystone alone.

The idea to allow multiple uuids that were joined together was
mentioned before in a previous attempt to solve this issue [1].

This change:
- Allows 2 or more concatenated uuids to be considered valid without
emitting a warning
- Cleaned up the list of words that are exceptions for validation
- Added 'default' to list of valid words in exception list
- Added offending value to printed warning
- Broke up test_identifiers for better clarity about which tests
were valid. This also solves the issue of `warning_mock.called` always
being `True` once an invalid uuid of type string was checked within
test_identifier
- Added test for valid exception words and extra characters that
can be present in a valid uuid according to [2]

[0] https://bugs.launchpad.net/keystone/+bug/1659053
[1] https://bugs.launchpad.net/keystone/+bug/1521844
[2] https://docs.python.org/2/library/uuid.html

Co-Authored-By: Tin Lam <tinlam@gmail.com>

Partial-Bug: #1659053
Change-Id: I58bba04c21c2d24fd37850c9ecc6fac99deb3fc4
2017-02-06 17:00:44 -06:00
..
2015-01-28 22:48:48 +00:00
2013-08-02 10:44:41 -04:00
2014-07-29 18:05:36 -05:00
2015-02-04 01:42:07 -05:00
2014-08-20 21:29:06 -05:00
2014-07-29 18:05:36 -05:00
2015-09-24 12:01:30 +10:00
2016-01-07 11:03:58 +08:00
2014-07-29 18:05:36 -05:00
2014-07-29 18:05:36 -05:00
2014-08-15 23:20:18 +00:00
2014-07-29 18:05:36 -05:00
2014-07-29 18:05:36 -05:00
2014-07-29 18:05:36 -05:00
2014-07-29 18:05:36 -05:00
2014-07-29 18:05:36 -05:00
2014-07-29 18:05:36 -05:00