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
This commit is contained in:
Gauvain Pocentek 2015-05-09 16:12:41 +02:00
parent dec4db24b4
commit fc33f23051
2 changed files with 11 additions and 0 deletions

View File

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

View File

@ -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: