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:
parent
dec4db24b4
commit
fc33f23051
|
@ -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
|
||||
----
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue