From 40771a06c077f34d4d50cd3aa5df459af1be96da Mon Sep 17 00:00:00 2001 From: wangqi Date: Thu, 17 May 2018 13:43:22 +0000 Subject: [PATCH] Replace deprecated library function os.popen() with subprocess os.popen() is deprecated since version 2.6. Resolved with use of subprocess module. Change-Id: I895f12807b3823f649369f27495c9182f01a7a14 --- deploy-guide/source/conf.py | 4 +++- doc/source/conf.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy-guide/source/conf.py b/deploy-guide/source/conf.py index eb5e4c1835..b97a11c341 100644 --- a/deploy-guide/source/conf.py +++ b/deploy-guide/source/conf.py @@ -24,6 +24,7 @@ import os import sys +import subprocess import openstackdocstheme @@ -51,7 +52,8 @@ if current_series == "latest": suse_series = previous_series_name.capitalize() else: watermark = series_names = current_series.capitalize() - latest_tag = os.popen('git describe --abbrev=0 --tags').read().strip('\n') + git_cmd = ["git", "describe", "--abbrev=0", "--tags"] + latest_tag = subprocess.Popen(git_cmd,stdout=subprocess.PIPE).communicate()[0].strip('\n') rdo_series = current_series_name suse_series = current_series_name.capitalize() diff --git a/doc/source/conf.py b/doc/source/conf.py index ad186762f9..bec4cab5e5 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -26,6 +26,7 @@ import imp import os import re import sys +import subprocess import openstackdocstheme @@ -53,7 +54,8 @@ if current_series == "latest": upgrade_warning = "Upgrading to master is not recommended. Master is under heavy development, and is not stable." else: watermark = series_names = current_series.capitalize() - latest_tag = os.popen('git describe --abbrev=0 --tags').read().strip('\n') + git_cmd = ["git", "describe", "--abbrev=0", "--tags"] + latest_tag = subprocess.Popen(git_cmd,stdout=subprocess.PIPE).communicate()[0].strip('\n') branch = "stable/{}".format(current_series) upgrade_warning = "The upgrade is always under active development."