4 from api.utils.common import result_handler
5 from yardstick.common import constants as consts
7 LOG = logging.getLogger(__name__)
8 LOG.setLevel(logging.DEBUG)
12 return get_case_docs(args)
15 def get_case_docs(args):
17 case_name = args['case_name']
19 return result_handler(consts.API_ERROR, 'case_name must be provided')
21 docs_path = os.path.join(consts.DOCS_DIR, '{}.rst'.format(case_name))
23 if not os.path.exists(docs_path):
24 return result_handler(consts.API_ERROR, 'case not exists')
26 LOG.info('Reading %s', case_name)
27 with open(docs_path) as f:
30 return result_handler(consts.API_SUCCESS, {'docs': content})