Eric Fried 63d7649ed5 UUID sentinel
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
2018-08-28 12:55:33 +00:00
2018-04-24 14:23:21 +00:00
2018-08-28 12:55:33 +00:00
2018-07-26 12:40:33 +00:00
2018-07-04 08:28:15 +07:00
2018-07-04 08:28:15 +07:00
2015-11-16 23:17:37 +08:00
2018-07-04 08:28:15 +07:00
2018-06-21 13:24:46 +08:00
2017-03-03 00:03:24 +00:00
2018-07-04 08:28:15 +07:00
2018-07-04 08:28:15 +07:00

Team and repository tags

image

oslo.utils

Latest Version

Downloads

The oslo.utils library provides support for common utility type functions, such as encoding, exception handling, string manipulation, and time handling.

Description
OpenStack library utils
Readme 8 MiB
Languages
Python 100%