From fc33f23051f881ec8e8345e0057b5cc51132b4d5 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 9 May 2015 16:12:41 +0200 Subject: [PATCH] diff_branches: improve handling of deprecated options Add options containing DEPRECATED in their help strings to the deprecation list. Change-Id: Ie61b71754b02c8d97019aea71f0b1e1d4862e95e Partial-Bug: #1433367 --- RELEASE_NOTES.rst | 2 ++ autogenerate_config_docs/diff_branches.py | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/RELEASE_NOTES.rst b/RELEASE_NOTES.rst index d9f3d3e1..af4eb3e8 100644 --- a/RELEASE_NOTES.rst +++ b/RELEASE_NOTES.rst @@ -5,6 +5,8 @@ Release notes ---- * ``openstack-doc-test``: Sort entries in index.html file. +* ``diff_branches.py``: Add options containing DEPRECATED in their help + string to the deprecation list. 0.27 ---- diff --git a/autogenerate_config_docs/diff_branches.py b/autogenerate_config_docs/diff_branches.py index af430a4e..0ef25d52 100755 --- a/autogenerate_config_docs/diff_branches.py +++ b/autogenerate_config_docs/diff_branches.py @@ -170,6 +170,12 @@ def diff(old_list, new_list): # Find options that have been deprecated in the new release. # If an option name is a key in the old_list dict, it means that it # wasn't deprecated. + + # Some options are deprecated, but not replaced with a new option. + # These options usually contain 'DEPRECATED' in their help string. + if 'DEPRECATED' in option['help']: + deprecated_opts.append((name, None)) + for deprecated in option['deprecated_opts']: # deprecated_opts is a list which always holds at least 1 invalid # dict. Forget it. @@ -189,6 +195,9 @@ def diff(old_list, new_list): def format_option_name(name): """Return a formatted string for the option path.""" + if name is None: + return "None" + try: section, name = name.split('/') except ValueError: