summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/nova-compute2
-rw-r--r--nova/exception.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/bin/nova-compute b/bin/nova-compute
index 814147d66..d99a21051 100755
--- a/bin/nova-compute
+++ b/bin/nova-compute
@@ -64,7 +64,7 @@ def block_db_access():
def __call__(self, *args, **kwargs):
stacktrace = "".join(traceback.format_stack())
LOG.error('No db access allowed in nova-compute: %s' % stacktrace)
- raise exception.DBError('No db access allowed in nova-compute')
+ raise exception.DBNotAllowed('nova-compute')
nova.db.api.IMPL = NoDB()
diff --git a/nova/exception.py b/nova/exception.py
index ede512a97..0ff485f9b 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -1115,3 +1115,8 @@ class InstanceRecreateNotSupported(Invalid):
class ServiceGroupUnavailable(NovaException):
message = _("The service from servicegroup driver %(driver) is "
"temporarily unavailable.")
+
+
+class DBNotAllowed(NovaException):
+ message = _('%(binary)s attempted direct database access which is '
+ 'not allowed by policy')