From 785f23b3bc219c554698fe54fbd478ef04fc9229 Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Wed, 30 Aug 2023 14:47:49 +0000 Subject: [PATCH] Add default to read_deleted in context's from_dict this is follow-up to Ic94323658c89df1c1ff32f511ca23502317d0f00 currently the defaults in __init__ and from_dict of RequestContext for read_deleted property are different: - in __init__ it is 'no' - in from_dict, it is effectively None. And at the same time, this property is not allowed to be None. As a result, the new _sanitize_context in oslo.messaging can not create a sanitized context copy with error read_deleted can only be one of 'no', 'yes' or 'only', not None Related-Bug: #2030976 Change-Id: Ifb660688c590fb1c32cbe0ae03e0ea444f19cbb8 --- cinder/context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/context.py b/cinder/context.py index 147609302eb..21454cb42fe 100644 --- a/cinder/context.py +++ b/cinder/context.py @@ -190,7 +190,7 @@ class RequestContext(context.RequestContext): project_id=values.get('project_id'), project_name=values.get('project_name'), domain_id=values.get('domain_id'), - read_deleted=values.get('read_deleted'), + read_deleted=values.get('read_deleted', 'no'), remote_address=values.get('remote_address'), timestamp=values.get('timestamp'), quota_class=values.get('quota_class'),