Remove subprocess call

pbr version can give us this for relatively cheap.

Change-Id: I7ddc1fccf926edb92058abf0a80db838ffc74c38
This commit is contained in:
Jean-Philippe Evrard 2019-04-06 08:14:04 +02:00
parent ef03b506e0
commit b9e3deb8c2
2 changed files with 6 additions and 8 deletions

View File

@ -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()

View File

@ -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."