Comment 2 for bug 1283550

Revision history for this message
Stephen Gordon (sgordon) wrote :

The docs team has a utility that uses the bash-completion to generate the CLI documentation - no extra changes are required in the CLI *if* it exposes a bash-completion action. The script in question is here:

http://git.openstack.org/cgit/openstack/openstack-doc-tools/tree/os_doc_tools/commands.py

I'm in the process of changing it to accept/generate docs for the unified CLI, but it does not appear to have the required action:

$ python commands.py openstack
OpenStack Auto Documenting of Commands (using openstack-doc-tools version 0.8.2)

Documenting 'openstack'
Documenting 'openstack help'
Documenting 'openstack' subcommands...
ERROR: cliff.app Unknown command ['bash-completion']
Traceback (most recent call last):
  File "commands.py", line 528, in <module>
    sys.exit(main())
  File "commands.py", line 524, in main
    document_single_project(prog_args.client)
  File "commands.py", line 491, in document_single_project
    subcommands)
  File "commands.py", line 409, in generate_subcommands
    "bash-completion"]).strip().split()
  File "commands.py", line 40, in check_output
    raise subprocess.CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['openstack', 'bash-completion']' returned non-zero exit status 2
$ openstack bash-completion
ERROR: cliff.app Unknown command ['bash-completion']

If I run one of the traditional clients with the bash-completion argument (i.e. nova) then it spits out the expected output listing arguments etc.

Installed python-openstackclient from pip is:

$ pip show python-openstackclient
---
Name: python-openstackclient
Version: 0.3.0
Location: /usr/lib/python2.7/site-packages
Requires: pbr, cliff, keyring, pycrypto, python-glanceclient, python-keystoneclient, python-novaclient, python-cinderclient, requests, six