Comment 5 for bug 1659053

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pycadf (master)

Reviewed: https://review.openstack.org/428543
Committed: https://git.openstack.org/cgit/openstack/pycadf/commit/?id=a4a8f46248ab1d1a68d422276df21f75b24be84c
Submitter: Jenkins
Branch: master

commit a4a8f46248ab1d1a68d422276df21f75b24be84c
Author: Gage Hugo <email address hidden>
Date: Thu Feb 2 20:01:53 2017 -0600

    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 <email address hidden>

    Partial-Bug: #1659053
    Change-Id: I58bba04c21c2d24fd37850c9ecc6fac99deb3fc4