From ea5a85ca57512db31772722a7744dfd07d66c748 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Sat, 12 Jan 2019 13:43:02 +0100 Subject: [PATCH] Use yaml instead of parsing the text The gnocchi.yml is YAML formatted, so it's easier to use yaml to load data, vs parsing it as a text file. YAML is installed in the venv anyway, so it comes for free. Change-Id: I98c48820827087890a6c1a7391acf479c89142c5 (cherry picked from commit cc58bfe3426483c74bf07ca75ff79f2ea5579807) --- doc/source/conf.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0d60a1ec35..558d2ce930 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -29,6 +29,7 @@ import sys import subprocess import openstackdocstheme +import yaml # -- OpenStack-Ansible configuration -------------------------------------- # Variables to override @@ -62,8 +63,8 @@ else: CONF_PATH = os.path.dirname(os.path.realpath(__file__)) GNOCCHI_DETAILS = '../../playbooks/defaults/repo_packages/gnocchi.yml' with open(os.path.join(CONF_PATH, GNOCCHI_DETAILS), 'r') as fdesc: - result = re.search('gnocchi_git_install_branch:.*# HEAD of "(.*)".*', fdesc.read()) - gnocchi_branch = result.groups()[0] + gnocchi_file_content = yaml.safe_load(fdesc) + gnocchi_branch = gnocchi_file_content['gnocchi_git_track_branch'] # References variable for substitutions upgrade_backup_dir = "``/etc/openstack_deploy.{branchname}``".format(branchname=previous_series_name.upper())