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