Merge "Fix for getting glance command list"

This commit is contained in:
Jenkins 2015-11-20 10:30:43 +00:00 committed by Gerrit Code Review
commit 1d0851cd74
1 changed files with 11 additions and 5 deletions

View File

@ -289,6 +289,11 @@ def generate_command(os_command, os_file):
:param os_file: open filehandle for output of DocBook file
"""
if os_command == "glance":
help_lines = subprocess.check_output([os_command, "help"],
universal_newlines=True,
stderr=DEVNULL).split('\n')
else:
help_lines = subprocess.check_output([os_command, "--help"],
universal_newlines=True,
stderr=DEVNULL).split('\n')
@ -312,8 +317,9 @@ def generate_command(os_command, os_file):
next_line_screen = True
os_file.write("</computeroutput></screen>\n")
in_screen = False
format_table('Subcommands', help_lines[line_index + 2:],
os_file)
if os_command != "glance":
format_table('Subcommands',
help_lines[line_index + 2:], os_file)
continue
if line.startswith(('Optional arguments:', 'Optional:',
'Options:', 'optional arguments')):