From d1a9fc4f909560d6488a3a6acad4cea5cd91003c Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Thu, 26 Mar 2015 13:21:52 +0100 Subject: [PATCH] [commands] extract correct version string when client is deprecated With the deprecation of python-keystoneclient the output of keystone --version changed to: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient. 'python-keystoneclient.', DeprecationWarning) 1.3.0 Because of that it is necessary to only handle the last line of the output to extract the version string. Change-Id: Ibdfaa1de4f1c8880ce1a049fec9bea3004c11fea --- os_doc_tools/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os_doc_tools/commands.py b/os_doc_tools/commands.py index 89052ab0..3c0ef17d 100644 --- a/os_doc_tools/commands.py +++ b/os_doc_tools/commands.py @@ -65,7 +65,7 @@ def generate_heading(os_command, api_name, title, os_file): print("Command %s not found, aborting." % os_command) sys.exit(1) # Extract version from "swift 0.3" - version = version.strip().rpartition(' ')[2] + version = version.splitlines()[-1].strip().rpartition(' ')[2] print("Documenting '%s help (version %s)'" % (os_command, version))