Merge "Fix compatability with new oslo.messaging"
This commit is contained in:
commit
b72beecca2
@ -117,7 +117,12 @@ class RequestContext(context.RequestContext):
|
||||
LOG.debug('Arguments dropped when creating context: %s',
|
||||
str(kwargs))
|
||||
|
||||
self.read_deleted = read_deleted
|
||||
if read_deleted is None:
|
||||
# If we did not get a value for read_deleted, ensure we default
|
||||
# it to "no" as code expects it to be a string.
|
||||
self.read_deleted = 'no'
|
||||
else:
|
||||
self.read_deleted = read_deleted
|
||||
self.remote_address = remote_address
|
||||
if not timestamp:
|
||||
timestamp = timeutils.utcnow()
|
||||
|
@ -57,6 +57,11 @@ class ContextTestCase(test.NoDBTestCase):
|
||||
ctxt.read_deleted = 'no'
|
||||
self.assertEqual('no', ctxt.read_deleted)
|
||||
|
||||
def test_request_context_read_deleted_none(self):
|
||||
ctxt = context.RequestContext('111',
|
||||
'222')
|
||||
self.assertEqual('no', ctxt.read_deleted)
|
||||
|
||||
def test_request_context_read_deleted_invalid(self):
|
||||
self.assertRaises(ValueError,
|
||||
context.RequestContext,
|
||||
|
Loading…
Reference in New Issue
Block a user