def get_internal_tenant_context():
 project_id = CONF.cinder_internal_tenant_project_id
 user_id = CONF.cinder_internal_tenant_user_id
 if (project_id and user_id):
  return RequestContext(user_id=user_id, project_id=project_id, is_admin=True)
 else:
  LOG.warning(_LW('Unable to get internal tenant context: Missing required config parameters.'))
  return None

def get_internal_tenant_context ( ) : project_id = CONF . cinder_internal_tenant_project_id user_id = CONF . cinder_internal_tenant_user_id if ( project_id and user_id ) : return RequestContext ( user_id = user_id , project_id = project_id , is_admin = True ) else : LOG . warning ( _LW ( 'Unable to get internal tenant context: Missing required config parameters.' ) ) return None
build and return the cinder internal tenant context object this request context will only work for internal cinder operations .