Merge "trivial: Fix logging issues"
This commit is contained in:
@@ -30,7 +30,6 @@ from oslo_versionedobjects._i18n import _
|
||||
from oslo_versionedobjects import exception
|
||||
from oslo_versionedobjects import fields as obj_fields
|
||||
|
||||
|
||||
LOG = logging.getLogger('object')
|
||||
|
||||
|
||||
@@ -386,12 +385,9 @@ class VersionedObject:
|
||||
def obj_class_from_name(cls, objname, objver):
|
||||
"""Returns a class from the registry based on a name and version."""
|
||||
if objname not in VersionedObjectRegistry.obj_classes():
|
||||
(
|
||||
LOG.error(
|
||||
'Unable to instantiate unregistered object type '
|
||||
'%(objtype)s'
|
||||
),
|
||||
dict(objtype=objname),
|
||||
LOG.error(
|
||||
'Unable to instantiate unregistered object type %(objtype)s',
|
||||
{'objtype': objname},
|
||||
)
|
||||
raise exception.UnsupportedObjectError(objtype=objname)
|
||||
|
||||
|
||||
@@ -385,14 +385,14 @@ class UUID(StringPattern):
|
||||
# This is to ensure no breaking behaviour for current
|
||||
# users
|
||||
warnings.warn(
|
||||
"{} is an invalid UUID. Using UUIDFields "
|
||||
"with invalid UUIDs is no longer "
|
||||
"supported, and will be removed in a future "
|
||||
"release. Please update your "
|
||||
"code to input valid UUIDs or accept "
|
||||
"ValueErrors for invalid UUIDs. See "
|
||||
"https://docs.openstack.org/oslo.versionedobjects/latest/reference/fields.html#oslo_versionedobjects.fields.UUIDField " # noqa
|
||||
"for further details".format(repr(value).encode('utf8')),
|
||||
f"{value!r} is an invalid UUID. Using UUIDFields "
|
||||
f"with invalid UUIDs is no longer "
|
||||
f"supported, and will be removed in a future "
|
||||
f"release. Please update your "
|
||||
f"code to input valid UUIDs or accept "
|
||||
f"ValueErrors for invalid UUIDs. See "
|
||||
f"https://docs.openstack.org/oslo.versionedobjects/latest/reference/fields.html#oslo_versionedobjects.fields.UUIDField " # noqa
|
||||
f"for further details",
|
||||
FutureWarning,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user