novaclient.shell module

Command-line interface to the OpenStack Nova API.

class novaclient.shell.DeprecatedAction(option_strings, dest, help=None, real_action=None, use=None, **kwargs)

Bases: Action

An argparse action for deprecated options.

This class is an argparse.Action subclass that allows command line options to be explicitly deprecated. It modifies the help text for the option to indicate that it’s deprecated (unless help has been suppressed using argparse.SUPPRESS), and provides a means to specify an alternate option to use using the use keyword argument to argparse.ArgumentParser.add_argument(). The original action may be specified with the real_action keyword argument, which has the same interpretation as the action argument to argparse.ArgumentParser.add_argument(), with the addition of the special “nothing” action which completely ignores the option (other than emitting the deprecation warning). Note that the deprecation warning is only emitted once per specific option string.

Note: If the real_action keyword argument specifies an unknown action, no warning will be emitted unless the action is used, due to limitations with the method used to resolve the action names.

Initialize a DeprecatedAction instance.

Parameters:
  • option_strings – The recognized option strings.

  • dest – The attribute that will be set.

  • help – Help text. This will be updated to indicate the deprecation, and if use is provided, that text will be included as well.

  • real_action – The actual action to invoke. This is interpreted the same way as the action parameter.

  • use – Text explaining which option to use instead.

class novaclient.shell.NovaClientArgumentParser(*args, **kwargs)

Bases: ArgumentParser

error(message: string)

Prints a usage message incorporating the message to stderr and exits.

class novaclient.shell.OpenStackComputeShell

Bases: object

do_bash_completion(_args)

Prints all of the commands and options to stdout so that the nova.bash_completion script doesn’t have to hard code them.

do_help(args)

Display help about this program or one of its subcommands.

get_base_parser(argv)
get_subcommand_parser(version, do_help=False, argv=None)
main(argv)
setup_debugging(debug)
times = []
class novaclient.shell.OpenStackHelpFormatter(prog, indent_increment=2, max_help_position=32, width=None)

Bases: HelpFormatter

start_section(heading)
novaclient.shell.main(argv=['-W', '-b', 'html', '-d', 'doc/build/doctrees', 'doc/source', 'doc/build/html'])