![Eric Fried](/assets/img/avatar_default.png)
Add a private _UUIDSentinels() class to oslo_utils.fixture that behaves like a mock.sentinel, but returns specifically UUIDs. Expose a (singleton) instance of it called uuidsentinel. This is mostly copied from [1], with the following differences: - We don't do the enforced-singleton thing [2]. But importing the uuidsentinel global yields the same behavior. - We don't do the local import thing [3][4], because we're already in the right lib, so no issues with circular imports. - Locking is added to make this threadsafe. (See discussion at [5]) Note that there is some question as to whether it is more appropriate for this to live here or in oslotest [6]. This has been discussed on the dev ML [7] and it was concluded [8] that it should live here. [1]722d5b4772/nova/tests/uuidsentinel.py
[2]722d5b4772/nova/tests/uuidsentinel.py (L30)
[3]722d5b4772/nova/tests/uuidsentinel.py (L18-L19)
[4]722d5b4772/nova/tests/uuidsentinel.py (L26)
[5] http://eavesdrop.openstack.org/irclogs/%23openstack-oslo/%23openstack-oslo.2018-08-20.log.html#t2018-08-20T20:10:33 [6] https://review.openstack.org/#/c/594068/ [7] http://lists.openstack.org/pipermail/openstack-dev/2018-August/133670.html [8] http://lists.openstack.org/pipermail/openstack-dev/2018-August/133861.html Change-Id: I214ff21b461fa1ca4b83476e1d0a763efe986217
Team and repository tags
oslo.utils
The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling.
- Free software: Apache license
- Documentation: https://docs.openstack.org/oslo.utils/latest/
- Source: https://git.openstack.org/cgit/openstack/oslo.utils
- Bugs: https://bugs.launchpad.net/oslo.utils
- Release notes: https://docs.openstack.org/releasenotes/oslo.utils/
Description
Languages
Python
100%