[autohelp] misc fixes
- wrapper: upgrade setuptools in the generated venvs - swift: read from docbook on liberty - swift: ignore :ref: directives - swift: remove a bogus sys.exit(0) Change-Id: If983da606e51f39c9e331aa27c3e3598abc695fe
This commit is contained in:
parent
0c96872119
commit
5c930e29bd
|
@ -63,7 +63,7 @@ activate_venv() {
|
||||||
project=$1
|
project=$1
|
||||||
|
|
||||||
. $VENVDIR/$project/bin/activate
|
. $VENVDIR/$project/bin/activate
|
||||||
pip install --upgrade pip
|
pip install --upgrade pip setuptools
|
||||||
}
|
}
|
||||||
|
|
||||||
get_project() {
|
get_project() {
|
||||||
|
|
|
@ -83,6 +83,8 @@ def get_options(project, branch, args):
|
||||||
cmd = ("python extract_swift_flags.py dump "
|
cmd = ("python extract_swift_flags.py dump "
|
||||||
"-s %(sources)s/swift -m %(sources)s/openstack-manuals" %
|
"-s %(sources)s/swift -m %(sources)s/openstack-manuals" %
|
||||||
{'sources': args.sources})
|
{'sources': args.sources})
|
||||||
|
if branch == 'stable/liberty':
|
||||||
|
cmd += " -f docbook"
|
||||||
repo_path = args.sources
|
repo_path = args.sources
|
||||||
else:
|
else:
|
||||||
packages = _get_packages(project, branch)
|
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):
|
for name in sorted(new_opts, _cmpopts):
|
||||||
opt = new_list[name][1]
|
opt = new_list[name][1]
|
||||||
name = format_option_name(name)
|
name = format_option_name(name)
|
||||||
|
helptext = opt['help'].strip().replace('\n', ' ')
|
||||||
|
helptext = ' '.join(helptext.split())
|
||||||
cells = (("%(name)s = %(default)s" %
|
cells = (("%(name)s = %(default)s" %
|
||||||
{'name': name,
|
{'name': name,
|
||||||
'default': opt['default']}).strip(),
|
'default': opt['default']}).strip(),
|
||||||
"(%(type)s) %(help)s" % {'type': opt['type'],
|
"(%(type)s) %(help)s" % {'type': opt['type'],
|
||||||
'help': opt['help']})
|
'help': helptext})
|
||||||
env['new_opts'].append(cells)
|
env['new_opts'].append(cells)
|
||||||
|
|
||||||
# New defaults
|
# New defaults
|
||||||
|
|
|
@ -86,7 +86,7 @@ def get_existing_options_from_rst(optfiles):
|
||||||
"""Parse an existing RST table to compile a list of existing options."""
|
"""Parse an existing RST table to compile a list of existing options."""
|
||||||
options = {}
|
options = {}
|
||||||
for optfile in optfiles:
|
for optfile in optfiles:
|
||||||
input_string = open(optfile).read()
|
input_string = open(optfile).read().replace(':ref:', '')
|
||||||
output, pub = core.publish_programmatically(
|
output, pub = core.publish_programmatically(
|
||||||
source_class=io.StringInput, source=input_string,
|
source_class=io.StringInput, source=input_string,
|
||||||
source_path=optfile, destination_class=io.NullOutput,
|
source_path=optfile, destination_class=io.NullOutput,
|
||||||
|
@ -114,7 +114,7 @@ def get_existing_options(optfiles):
|
||||||
for optfile in optfiles:
|
for optfile in optfiles:
|
||||||
if optfile.endswith('/swift-conf-changes.xml'):
|
if optfile.endswith('/swift-conf-changes.xml'):
|
||||||
continue
|
continue
|
||||||
xml = etree.fromstring(open(optfile).read())
|
xml = etree.fromstring(open(optfile).read().replace(':ref:', ''))
|
||||||
tbody = xml.find(DBK_NS + "tbody")
|
tbody = xml.find(DBK_NS + "tbody")
|
||||||
trlist = tbody.findall(DBK_NS + "tr")
|
trlist = tbody.findall(DBK_NS + "tr")
|
||||||
for tr in trlist:
|
for tr in trlist:
|
||||||
|
@ -224,8 +224,6 @@ def read_options(swift_repo, manuals_repo, read_from, verbose):
|
||||||
options = get_existing_options(
|
options = get_existing_options(
|
||||||
glob.glob(manuals_repo + '/doc/common/tables/swift*xml'))
|
glob.glob(manuals_repo + '/doc/common/tables/swift*xml'))
|
||||||
|
|
||||||
sys.exit(0)
|
|
||||||
|
|
||||||
option_descs = extract_descriptions_from_devref(swift_repo, options)
|
option_descs = extract_descriptions_from_devref(swift_repo, options)
|
||||||
conf_samples = glob.glob(swift_repo + '/etc/*conf-sample')
|
conf_samples = glob.glob(swift_repo + '/etc/*conf-sample')
|
||||||
for sample in conf_samples:
|
for sample in conf_samples:
|
||||||
|
|
Loading…
Reference in New Issue