API¶
upgradecheck module¶
-
class
oslo_upgradecheck.upgradecheck.
Code
¶ Status codes for the upgrade check command
-
class
oslo_upgradecheck.upgradecheck.
Result
(code, details=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
()¶ 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, project, upgrade_command, argv=['-W', '-b', 'html', 'doc/source', 'doc/build/html'], default_config_files=None)¶ 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, upgrade_command)¶ 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)¶ Run the requested command.
- Parameters
conf – An oslo.confg ConfigOpts instance on which the upgrade commands have been previously registered.