Fix UserNotFound exception for expiring groups

Without this patch, if this exception is reached, it won't be properly
formed and will result in a log message like this:

  Failed to insert replacement values into translated message Could not
  find user: %(user_id)s. (Original: 'Could not find user:
  %(user_id)s.'): 'user_id'

This patch adds the right parameters to ensure the exception properly
logs the user ID and the translation doesn't fail.

Change-Id: I3229d9a237633cda8f6a25f396a75b8310757d9d
(cherry picked from commit 2d26a87229)
This commit is contained in:
Colleen Murphy 2020-05-10 22:36:21 -07:00
parent 28bce595bb
commit 6b8e036baf
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ class ShadowUsers(base.ShadowUsersDriverBase):
if not user:
# Note(knikolla): This shouldn't really ever happen, since
# this requires the user to already be logged in.
raise exception.UserNotFound()
raise exception.UserNotFound(user_id=user_id)
return user
with sql.session_for_write() as session: