From b9e3deb8c22d7929acd26b46e9536a8a51713a49 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Sat, 6 Apr 2019 08:14:04 +0200 Subject: [PATCH] Remove subprocess call pbr version can give us this for relatively cheap. Change-Id: I7ddc1fccf926edb92058abf0a80db838ffc74c38 --- deploy-guide/source/conf.py | 7 +++---- doc/source/conf.py | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/deploy-guide/source/conf.py b/deploy-guide/source/conf.py index 10d73ce6f3..1c2766481e 100644 --- a/deploy-guide/source/conf.py +++ b/deploy-guide/source/conf.py @@ -26,6 +26,7 @@ import os import sys import subprocess +import pbr.version import openstackdocstheme # -- OpenStack-Ansible configuration -------------------------------------- @@ -46,14 +47,12 @@ title = 'OpenStack-Ansible Documentation' current_series = openstackdocstheme.ext._get_series_name() if current_series == "latest": - watermark = "Pre-release" latest_tag = "master" rdo_series = previous_series_name suse_series = previous_series_name.capitalize() else: - watermark = series_names = current_series.capitalize() - git_cmd = ["git", "describe", "--abbrev=0", "--tags"] - latest_tag = subprocess.Popen(git_cmd,stdout=subprocess.PIPE).communicate()[0].strip('\n') + series_names = current_series.capitalize() + latest_tag = pbr.version.VersionInfo('osa_toolkit').__str__() rdo_series = current_series_name suse_series = current_series_name.capitalize() diff --git a/doc/source/conf.py b/doc/source/conf.py index bc83f98eb2..e2549e2b66 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -29,6 +29,7 @@ import sys import subprocess import openstackdocstheme +import pbr.version import yaml # -- OpenStack-Ansible configuration -------------------------------------- @@ -49,14 +50,12 @@ title = 'OpenStack-Ansible Documentation' current_series = openstackdocstheme.ext._get_series_name() if current_series == "latest": - watermark = "Pre-release" latest_tag = "master" branch = "master" upgrade_warning = "Upgrading to master is not recommended. Master is under heavy development, and is not stable." else: - watermark = series_names = current_series.capitalize() - git_cmd = ["git", "describe", "--abbrev=0", "--tags"] - latest_tag = subprocess.Popen(git_cmd,stdout=subprocess.PIPE).communicate()[0].strip('\n') + series_names = current_series.capitalize() + latest_tag = pbr.version.VersionInfo('osa_toolkit').__str__() branch = "stable/{}".format(current_series) upgrade_warning = "The upgrade is always under active development."