Merge "[autohelp] misc fixes"

This commit is contained in:
Jenkins 2015-11-26 15:08:19 +00:00 committed by Gerrit Code Review
commit 18a251e7a8
3 changed files with 8 additions and 6 deletions

View File

@ -63,7 +63,7 @@ activate_venv() {
project=$1
. $VENVDIR/$project/bin/activate
pip install --upgrade pip
pip install --upgrade pip setuptools
}
get_project() {

View File

@ -83,6 +83,8 @@ def get_options(project, branch, args):
cmd = ("python extract_swift_flags.py dump "
"-s %(sources)s/swift -m %(sources)s/openstack-manuals" %
{'sources': args.sources})
if branch == 'stable/liberty':
cmd += " -f docbook"
repo_path = args.sources
else:
packages = _get_packages(project, branch)
@ -215,11 +217,13 @@ def get_env(project, new_branch, old_list, new_list):
for name in sorted(new_opts, _cmpopts):
opt = new_list[name][1]
name = format_option_name(name)
helptext = opt['help'].strip().replace('\n', ' ')
helptext = ' '.join(helptext.split())
cells = (("%(name)s = %(default)s" %
{'name': name,
'default': opt['default']}).strip(),
"(%(type)s) %(help)s" % {'type': opt['type'],
'help': opt['help']})
'help': helptext})
env['new_opts'].append(cells)
# New defaults

View File

@ -86,7 +86,7 @@ def get_existing_options_from_rst(optfiles):
"""Parse an existing RST table to compile a list of existing options."""
options = {}
for optfile in optfiles:
input_string = open(optfile).read()
input_string = open(optfile).read().replace(':ref:', '')
output, pub = core.publish_programmatically(
source_class=io.StringInput, source=input_string,
source_path=optfile, destination_class=io.NullOutput,
@ -114,7 +114,7 @@ def get_existing_options(optfiles):
for optfile in optfiles:
if optfile.endswith('/swift-conf-changes.xml'):
continue
xml = etree.fromstring(open(optfile).read())
xml = etree.fromstring(open(optfile).read().replace(':ref:', ''))
tbody = xml.find(DBK_NS + "tbody")
trlist = tbody.findall(DBK_NS + "tr")
for tr in trlist:
@ -224,8 +224,6 @@ def read_options(swift_repo, manuals_repo, read_from, verbose):
options = get_existing_options(
glob.glob(manuals_repo + '/doc/common/tables/swift*xml'))
sys.exit(0)
option_descs = extract_descriptions_from_devref(swift_repo, options)
conf_samples = glob.glob(swift_repo + '/etc/*conf-sample')
for sample in conf_samples: