# API

## upgradecheck module

class oslo_upgradecheck.upgradecheck.Code(*values)

  Status codes for the upgrade check command

class oslo_upgradecheck.upgradecheck.Result(code: Code, details: str | None = None)

  Class used for ‘nova-status upgrade check’ results.

  The ‘code’ attribute is a Code enum. The ‘details’ attribute is a translated message generally only used for checks that result in a warning or failure code. The details should provide information on what issue was discovered along with any remediation.

class oslo_upgradecheck.upgradecheck.UpgradeCommands

  Base class for upgrade checks

  This class should be inherited by a class in each project that provides the actual checks. Those checks should be added to the _upgrade_checks class member so that they are run when the `check` method is called.

  The subcommands here must not rely on the service object model since they should be able to run on n-1 data. Any queries to the database should be done through the sqlalchemy query language directly like the database schema migrations.

  check() → Code

    Performs checks to see if the deployment is ready for upgrade.

    These checks are expected to be run BEFORE services are restarted with new code.

    Returns:

      Code

oslo_upgradecheck.upgradecheck.main(conf: ConfigOpts, project: str, upgrade_command: UpgradeCommands, argv: list[str] = ['-b', 'html', 'doc/source', 'debian/python-oslo.upgradecheck-doc/usr/share/doc/python-oslo.upgradecheck-doc/html'], default_config_files: Iterable[str] | None = None) → int

  Simple implementation of main for upgrade checks

  This can be used in upgrade check commands to provide the minimum necessary parameter handling and logic.

  Parameters:

    - conf – An oslo.confg ConfigOpts instance on which to register the upgrade check arguments.

    - project – The name of the project, to be used as an argument to the oslo_config.ConfigOpts instance to find configuration files.

    - upgrade_command – The UpgradeCommands instance.

    - argv – The command line arguments to parse. Defaults to sys.argv[1:].

    - default_config_files – The configuration files to load. For projects that use non-standard default locations for the configuration files, use this to override the search behavior in oslo.config.

oslo_upgradecheck.upgradecheck.register_cli_options(conf: ConfigOpts, upgrade_command: UpgradeCommands) → None

  Set up the command line options.

  Adds a subcommand to support ‘upgrade check’ on the command line.

  Parameters:

    - conf – An oslo.confg ConfigOpts instance on which to register the upgrade check arguments.

    - upgrade_command – The UpgradeCommands instance.

oslo_upgradecheck.upgradecheck.run(conf: ConfigOpts) → int

  Run the requested command.

  Parameters:

    conf – An oslo.confg ConfigOpts instance on which the upgrade commands have been previously registered.

this page last updated: 2026-02-26 22:56:31

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug