def get_file(file_id, api=None):
# TODO: remove this function and just use the Pillar SDK directly.
if file_id is None:
return None
if api is None:
api = system_util.pillar_api()
try:
return File.find(file_id, api=api)
except ResourceNotFound:
f = sys.exc_info()[2].tb_frame.f_back
tb = traceback.format_stack(f=f, limit=2)
log.warning('File %s not found, but requested from %s\n%s',
file_id, request.url, ''.join(tb))
return None
评论列表
文章目录