def block_db_access(service_name):
 class NoDB(object, ):
  def __getattr__(self, attr):
   return self
  def __call__(self, *args, **kwargs):
   stacktrace = ''.join(traceback.format_stack())
   LOG.error(_LE('No db access allowed in %(service_name)s: %(stacktrace)s'), dict(service_name=service_name, stacktrace=stacktrace))
   raise exception.DBNotAllowed(service_name)
 nova.db.api.IMPL = NoDB()

def block_db_access ( service_name ) : class NoDB ( object , ) : def __getattr__ ( self , attr ) : return self def __call__ ( self , * args , ** kwargs ) : stacktrace = '' . join ( traceback . format_stack ( ) ) LOG . error ( _LE ( 'No db access allowed in %(service_name)s: %(stacktrace)s' ) , dict ( service_name = service_name , stacktrace = stacktrace ) ) raise exception . DBNotAllowed ( service_name ) nova . db . api . IMPL = NoDB ( )
blocks nova db access .