Use exception.CinderException instead of Exception

This patch also changes exception message to more user-friendly one. Of
course, 'die' is very funny but doesn't help during debug.

Change-Id: I5e859ac69c05606428d0bcacb604bbd6b40d69fc
This commit is contained in:
Ivan Kolodyazhny 2017-06-23 12:56:14 +03:00
parent cd881c7177
commit 50040f5655

View File

@ -121,9 +121,8 @@ def get_backend():
def is_admin_context(context):
"""Indicates if the request context is an administrator."""
if not context:
LOG.warning('Use of empty request context is deprecated',
DeprecationWarning)
raise Exception('die')
raise exception.CinderException(
'Use of empty request context is deprecated')
return context.is_admin