././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3627667 oslo_upgradecheck-2.7.0/0000775000175000017500000000000015133405611014022 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/.coveragerc0000664000175000017500000000015715133405522016147 0ustar00zuulzuul[run] branch = True source = oslo_upgradecheck omit = oslo_upgradecheck/tests/* [report] ignore_errors = True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/.mailmap0000664000175000017500000000013115133405522015437 0ustar00zuulzuul# Format is: # # ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/.pre-commit-config.yaml0000664000175000017500000000136015133405522020304 0ustar00zuulzuulrepos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: - id: trailing-whitespace - id: mixed-line-ending args: ['--fix', 'lf'] exclude: '.*\.(svg)$' - id: fix-byte-order-marker - id: check-executables-have-shebangs - id: check-merge-conflict - id: debug-statements - id: check-yaml files: .*\.(yaml|yml)$ - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.14.8 hooks: - id: ruff-check args: ['--fix', '--unsafe-fixes'] - id: ruff-format - repo: https://opendev.org/openstack/hacking rev: 8.0.0 hooks: - id: hacking additional_dependencies: [] exclude: '^(doc|releasenotes)/.*$' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/.stestr.conf0000664000175000017500000000006315133405522016273 0ustar00zuulzuul[DEFAULT] test_path=./oslo_upgradecheck top_dir=./ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/.zuul.yaml0000664000175000017500000000026715133405522015771 0ustar00zuulzuul- project: templates: - publish-openstack-docs-pti - openstack-python3-jobs - check-requirements - release-notes-jobs-python3 - periodic-stable-jobs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/AUTHORS0000664000175000017500000000156115133405611015075 0ustar00zuulzuulAndreas Jaeger Ben Nemec Charles Short Chris Dent Corey Bryant Daniel Bengtsson Dmitry Tantsur Doug Hellmann Ghanshyam Ghanshyam Mann Hervé Beraud Matt Riedemann Moisés Guimarães de Medeiros OpenStack Release Bot Sean McGinnis Slawek Kaplonski Stephen Finucane Takashi Kajinami Takashi Kajinami caoyuan jacky06 pengyuesheng qingszhao ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/CONTRIBUTING.rst0000664000175000017500000000153315133405522016466 0ustar00zuulzuulIf you would like to contribute to the development of oslo's libraries, first you must take a look to this page: https://specs.openstack.org/openstack/oslo-specs/specs/policy/contributing.html If you would like to contribute to the development of OpenStack, you must follow the steps in this page: http://docs.openstack.org/infra/manual/developers.html If you already have a good understanding of how the system works and your OpenStack accounts are set up, you can skip to the development workflow section of this documentation to learn how changes to OpenStack should be submitted for review via the Gerrit tool: http://docs.openstack.org/infra/manual/developers.html#development-workflow Pull requests submitted through GitHub will be ignored. Bugs should be filed on Launchpad, not GitHub: https://bugs.launchpad.net/oslo.upgradecheck ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/ChangeLog0000664000175000017500000001140615133405611015576 0ustar00zuulzuulCHANGES ======= 2.7.0 ----- * Add missing py.typed file * Enable logging related ruff checks * Delay string interpolations at logging calls * Add typing * Add ruff * reno: Update master for unmaintained/2024.1 * Bump pyupgrade target to 3.10+ * pre-commit: Bump dependencies * Migrate setup configuration to pyproject.toml * Drop Python 3.9 support * Update master for stable/2025.2 2.6.0 ----- * add pyproject.toml to support pip 23.1 * Update master for stable/2025.1 2.5.0 ----- * Skip installation to speed up pep8 * Run pyupgrade to clean up Python 2 syntaxes * pre-commit: Bump versions * reno: Update master for unmaintained/2023.1 * Add note about requirements lower bounds * Remove Python 3.8 support * Fix outdated tox minversion * Declare Python 3.12 support * Update master for stable/2024.2 2.4.0 ----- * reno: Update master for unmaintained/zed * Remove old excludes * Update master for stable/2024.1 * reno: Update master for unmaintained/xena * reno: Update master for unmaintained/wallaby * reno: Update master for unmaintained/victoria 2.3.0 ----- * Display coverage report * reno: Update master for unmaintained/yoga * Bump hacking * Update python classifier in setup.cfg * Remove translation sections from setup.cfg * Update master for stable/2023.2 2.2.0 ----- * Revert "Moves supported python runtimes from version 3.8 to 3.10" * Moves supported python runtimes from version 3.8 to 3.10 * Update master for stable/2023.1 2.1.1 ----- * clean up tox's python 3 specific conf * Fix issues related to tox4 2.1.0 ----- * Add Python3 antelope unit tests * Update master for stable/zed 2.0.0 ----- * Drop python3.6/3.7 support in testing runtime * Add Python3 zed unit tests * Update master for stable/yoga * setup.cfg: Replace dashes by underscores 1.5.0 ----- * Add Python3 yoga unit tests * Update master for stable/xena 1.4.0 ----- * Move flake8 as a pre-commit local target * Add Python3 xena unit tests * Update master for stable/wallaby * Remove lower-constraints remnants * Uncap PrettyTable * Remove six * Dropping lower constraints testing 1.3.0 ----- * Register oslo policy opts explicitly for check\_policy\_json * Fix lower-constraints job 1.2.0 ----- * Add common checks for json to yaml policy file migration * Use TOX\_CONSTRAINTS\_FILE * Use py3 as the default runtime for tox * Add Python3 wallaby unit tests * Update master for stable/victoria * Adding pre-commit 1.1.1 ----- 1.1.0 ----- * Switch to newer openstackdocstheme and reno versions * Align contributing doc with oslo's policy * Bump default tox env from py37 to py38 * Add py38 package metadata * Remove Babel from requirements * Add release notes links to doc index * Add Python3 victoria unit tests * Update master for stable/ussuri 1.0.1 ----- * Update hacking for Python3 * Use unittest.mock instead of third party mock 1.0.0 ----- * remove outdated header * [ussuri][goal] Drop python 2.7 support and testing 0.4.0 ----- * tox: Trivial cleanup * Bump Babel to 2.3.4 on lower-constraint * tox: Keeping going with docs * Switch to Ussuri jobs * Bump the openstackdocstheme extension to 1.20 * Update the constraints url * Update master for stable/train 0.3.2 ----- 0.3.1 ----- * Add Python 3 Train unit tests * Move doc related modules to doc/requirements.txt 0.3.0 ----- * Address nits from json change * Enable JSON results output * Sync Sphinx requirement * Replace git.openstack.org URLs with opendev.org URLs * OpenDev Migration Patch * Dropping the py35 testing * Update master for stable/stein 0.2.1 ----- 0.2.0 ----- * Change python3.5 job to python3.7 job on Stein+ * Add doc params to run and register\_cli\_opts * Move displayed checker title to be in variable * Separate opt registration from command running * Update py33,py34 to py35,py36 * doc: Switch to openstackdocstheme * doc: Remove crud from conf.py file * Change openstack-dev to openstack-discuss 0.1.1 ----- * Force translation of table header 0.1.0 ----- * Use template for lower-constraints zuul job * Move example implementation to docs * Add reno support * Don't run tempest jobs on changes * Add database access details to UpgradeCommands docstring * enable debug output for tests * tighten API for main() * Improve config handling * Modernize tox.ini * Use sphinx-build for all docs venvs * Add lower-constraints job * Shorten UpgradeCheck class names * Add proper documentation * Use python3 by default * Flesh out readme * Add .zuul.yaml and .stestr.conf * Flesh out readme * Add success test case * Handle exceptions from checks * Propagate return code * Add more unit tests * Test \_get\_details * Get coverage job working * Remove history file from docs * Migrate to stestr * Add docstring to main() * Fix pep8 failures * Proper requirements specification * Add \_i18n module * Add i18n support * Initial implementation * Initial commit ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/HACKING.rst0000664000175000017500000000023415133405522015620 0ustar00zuulzuuloslo.upgradecheck Style Commandments ==================================== Read the OpenStack Style Commandments https://docs.openstack.org/hacking/latest/ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/LICENSE0000664000175000017500000002363715133405522015043 0ustar00zuulzuul Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3627667 oslo_upgradecheck-2.7.0/PKG-INFO0000644000175000017500000000336115133405611015120 0ustar00zuulzuulMetadata-Version: 2.4 Name: oslo.upgradecheck Version: 2.7.0 Summary: Common code for writing OpenStack upgrade checks Author-email: OpenStack License: Apache-2.0 Project-URL: Homepage, https://docs.openstack.org/oslo.upgradecheck Project-URL: Repository, https://opendev.org/openstack/oslo.upgradecheck Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Requires-Python: >=3.10 Description-Content-Type: text/x-rst License-File: LICENSE Requires-Dist: oslo.config>=5.2.0 Requires-Dist: oslo.i18n>=3.15.3 Requires-Dist: PrettyTable>=0.7.1 Requires-Dist: oslo.utils>=4.5.0 Requires-Dist: oslo.policy>=2.0.0 Dynamic: license-file Dynamic: requires-dist ================= oslo.upgradecheck ================= Common code for writing OpenStack upgrade checks This project contains the common code necessary for writing upgrade checks in OpenStack projects. It includes a module (oslo_upgradecheck.upgradecheck) for the common code as well as an example (oslo_upgradecheck.__main__) of integrating that code into a project. * Free software: Apache license * Documentation: https://docs.openstack.org/oslo.upgradecheck/latest/ * Source: https://opendev.org/openstack/oslo.upgradecheck * Bugs: https://bugs.launchpad.net/oslo.upgradecheck ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/README.rst0000664000175000017500000000110715133405522015511 0ustar00zuulzuul================= oslo.upgradecheck ================= Common code for writing OpenStack upgrade checks This project contains the common code necessary for writing upgrade checks in OpenStack projects. It includes a module (oslo_upgradecheck.upgradecheck) for the common code as well as an example (oslo_upgradecheck.__main__) of integrating that code into a project. * Free software: Apache license * Documentation: https://docs.openstack.org/oslo.upgradecheck/latest/ * Source: https://opendev.org/openstack/oslo.upgradecheck * Bugs: https://bugs.launchpad.net/oslo.upgradecheck ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3507648 oslo_upgradecheck-2.7.0/doc/0000775000175000017500000000000015133405611014567 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/requirements.txt0000664000175000017500000000012415133405522020051 0ustar00zuulzuulsphinx>=2.0.0 # BSD reno>=3.1.0 # Apache-2.0 openstackdocstheme>=2.2.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1768819593.352765 oslo_upgradecheck-2.7.0/doc/source/0000775000175000017500000000000015133405611016067 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/api.rst0000664000175000017500000000016715133405522017377 0ustar00zuulzuul===== API ===== upgradecheck module ------------------- .. automodule:: oslo_upgradecheck.upgradecheck :members: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/conf.py0000664000175000017500000000357215133405522017376 0ustar00zuulzuul# Copyright (C) 2020 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config import os import sys sys.path.insert(0, os.path.abspath('../..')) # -- Project information ----------------------------------------------------- # General information about the project. copyright = '2018, Oslo Contributors' # -- General configuration ---------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'openstackdocstheme'] # The master toctree document. master_doc = 'index' # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # -- Options for HTML output -------------------------------------------------- # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. html_theme = 'openstackdocs' # -- Options for openstackdocstheme ------------------------------------------- openstackdocs_repo_name = 'openstack/oslo.upgradecheck' openstackdocs_bug_project = 'oslo.upgradecheck' openstackdocs_bug_tag = '' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/contributing.rst0000664000175000017500000000012115133405522021323 0ustar00zuulzuul============== Contributing ============== .. include:: ../../CONTRIBUTING.rst ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/index.rst0000664000175000017500000000151415133405522017732 0ustar00zuulzuul================= oslo.upgradecheck ================= Common code for writing OpenStack upgrade checks. This project can be used to assist with the implementation of a ``$SERVICE-status`` command that responds to parameters of ``upgrade check`` by running upgrade check functions on the existing installation. For further details see :doc:`usage` and the `Nova documentation on upgrade checks`_. .. _`Nova documentation on upgrade checks`: https://docs.openstack.org/nova/latest/reference/upgrade-checks.html Contents ======== .. toctree:: :maxdepth: 2 installation api usage contributing Release Notes ============= Read also the `oslo.upgradecheck Release Notes `_. Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/installation.rst0000664000175000017500000000015015133405522021317 0ustar00zuulzuul============== Installation ============== At the command line:: $ pip install oslo.upgradecheck ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/main.py0000664000175000017500000000233315133405522017367 0ustar00zuulzuul# Copyright 2018 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Example CLI command for running upgrade checks""" import sys from oslo_config import cfg from oslo_upgradecheck import upgradecheck class Checks(upgradecheck.UpgradeCommands): def success(self): return upgradecheck.Result( upgradecheck.Code.SUCCESS, 'Always succeeds' ) def failure(self): return upgradecheck.Result(upgradecheck.Code.FAILURE, 'Always fails') _upgrade_checks = (('always succeeds', success), ('always fails', failure)) def main(): return upgradecheck.main( conf=cfg.CONF, project='myprojectname', upgrade_command=Checks() ) if __name__ == '__main__': sys.exit(main()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/doc/source/usage.rst0000664000175000017500000000413215133405522017726 0ustar00zuulzuul======= Usage ======= See the module ``oslo_upgradecheck.__main__`` for an example of how to use this project. Each consuming project should create a class that inherits from :class:`oslo_upgradecheck.upgradecheck.UpgradeCommands` and implement check methods on it. Those check methods should then be added to the ``_upgrade_checks`` tuple so they will be run when the :meth:`oslo_upgradecheck.upgradecheck.UpgradeCommands.check` method is called. For example:: from oslo_upgradecheck import upgradecheck class ProjectSpecificUpgradeCommands(upgradecheck.UpgradeCommands): def an_upgrade_check(self): if everything_is_awesome(): return upgradecheck.Result( upgradecheck.Code.SUCCESS, 'Success details') else: return upgradecheck.Result( upgradecheck.Code.FAILURE, 'Failure details') _upgrade_checks = (('Awesome upgrade check', an_upgrade_check)) oslo.upgradecheck also includes a basic implementation of command line argument handling that can be used to provide the minimum processing needed to implement a ``$SERVICE-status upgrade check`` command. To make use of it, write a method that creates an instance of the class created above, then pass that class's ``check`` function into :func:`oslo_upgradecheck.upgradecheck.main`. The project's ConfigOpts instance must also be passed. In most projects this will just be cfg.CONF. For example:: from oslo_config import cfg def main(): return upgradecheck.main( conf=cfg.CONF, project='myprojectname', upgrade_command=ProjectSpecificUpgradeCommands(), ) The entry point for the ``$SERVICE-status`` command should then point at this function. Alternatively, if a project has its own CLI code that it would prefer to reuse, it simply needs to ensure that the ``inst.check`` method is called when the ``upgrade check`` parameters are passed to the ``$SERVICE-status`` command. Example ------- The following is a fully functional example of implementing a check command: .. literalinclude:: main.py ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3617666 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/0000775000175000017500000000000015133405611021114 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/PKG-INFO0000644000175000017500000000336115133405611022212 0ustar00zuulzuulMetadata-Version: 2.4 Name: oslo.upgradecheck Version: 2.7.0 Summary: Common code for writing OpenStack upgrade checks Author-email: OpenStack License: Apache-2.0 Project-URL: Homepage, https://docs.openstack.org/oslo.upgradecheck Project-URL: Repository, https://opendev.org/openstack/oslo.upgradecheck Classifier: Environment :: OpenStack Classifier: Intended Audience :: Information Technology Classifier: Intended Audience :: System Administrators Classifier: License :: OSI Approved :: Apache Software License Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Requires-Python: >=3.10 Description-Content-Type: text/x-rst License-File: LICENSE Requires-Dist: oslo.config>=5.2.0 Requires-Dist: oslo.i18n>=3.15.3 Requires-Dist: PrettyTable>=0.7.1 Requires-Dist: oslo.utils>=4.5.0 Requires-Dist: oslo.policy>=2.0.0 Dynamic: license-file Dynamic: requires-dist ================= oslo.upgradecheck ================= Common code for writing OpenStack upgrade checks This project contains the common code necessary for writing upgrade checks in OpenStack projects. It includes a module (oslo_upgradecheck.upgradecheck) for the common code as well as an example (oslo_upgradecheck.__main__) of integrating that code into a project. * Free software: Apache license * Documentation: https://docs.openstack.org/oslo.upgradecheck/latest/ * Source: https://opendev.org/openstack/oslo.upgradecheck * Bugs: https://bugs.launchpad.net/oslo.upgradecheck ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/SOURCES.txt0000664000175000017500000000336315133405611023005 0ustar00zuulzuul.coveragerc .mailmap .pre-commit-config.yaml .stestr.conf .zuul.yaml AUTHORS CONTRIBUTING.rst ChangeLog HACKING.rst LICENSE README.rst pyproject.toml requirements.txt setup.cfg setup.py test-requirements.txt tox.ini doc/requirements.txt doc/source/api.rst doc/source/conf.py doc/source/contributing.rst doc/source/index.rst doc/source/installation.rst doc/source/main.py doc/source/usage.rst oslo.upgradecheck.egg-info/PKG-INFO oslo.upgradecheck.egg-info/SOURCES.txt oslo.upgradecheck.egg-info/dependency_links.txt oslo.upgradecheck.egg-info/not-zip-safe oslo.upgradecheck.egg-info/pbr.json oslo.upgradecheck.egg-info/requires.txt oslo.upgradecheck.egg-info/top_level.txt oslo_upgradecheck/__init__.py oslo_upgradecheck/_i18n.py oslo_upgradecheck/common_checks.py oslo_upgradecheck/py.typed oslo_upgradecheck/upgradecheck.py oslo_upgradecheck/tests/__init__.py oslo_upgradecheck/tests/test_common_checks.py oslo_upgradecheck/tests/test_upgradecheck.py releasenotes/notes/drop-python27-support-bd23b9c4556739ba.yaml releasenotes/notes/json-output-78a9e19588b7b1e1.yaml releasenotes/notes/remove-py38-3c732ccf72eb235c.yaml releasenotes/notes/remove-py39-436fc297a6611ad2.yaml releasenotes/source/2023.1.rst releasenotes/source/2023.2.rst releasenotes/source/2024.1.rst releasenotes/source/2024.2.rst releasenotes/source/2025.1.rst releasenotes/source/2025.2.rst releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/stein.rst releasenotes/source/train.rst releasenotes/source/unreleased.rst releasenotes/source/ussuri.rst releasenotes/source/victoria.rst releasenotes/source/wallaby.rst releasenotes/source/xena.rst releasenotes/source/yoga.rst releasenotes/source/zed.rst releasenotes/source/_static/.placeholder releasenotes/source/_templates/.placeholder././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/dependency_links.txt0000664000175000017500000000000115133405611025162 0ustar00zuulzuul ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/not-zip-safe0000664000175000017500000000000115133405611023342 0ustar00zuulzuul ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/pbr.json0000664000175000017500000000005615133405611022573 0ustar00zuulzuul{"git_version": "bea7320", "is_release": true}././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/requires.txt0000664000175000017500000000013515133405611023513 0ustar00zuulzuuloslo.config>=5.2.0 oslo.i18n>=3.15.3 PrettyTable>=0.7.1 oslo.utils>=4.5.0 oslo.policy>=2.0.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819593.0 oslo_upgradecheck-2.7.0/oslo.upgradecheck.egg-info/top_level.txt0000664000175000017500000000002215133405611023640 0ustar00zuulzuuloslo_upgradecheck ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3557656 oslo_upgradecheck-2.7.0/oslo_upgradecheck/0000775000175000017500000000000015133405611017503 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/__init__.py0000664000175000017500000000000015133405522021603 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/_i18n.py0000664000175000017500000000212615133405522020775 0ustar00zuulzuul# Copyright 2018 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import oslo_i18n DOMAIN = "oslo_upgradecheck" _translators = oslo_i18n.TranslatorFactory(domain=DOMAIN) # The primary translation function using the well-known name "_" _ = _translators.primary # The contextual translation function using the name "_C" # requires oslo.i18n >=2.1.0 _C = _translators.contextual_form # The plural translation function using the name "_P" # requires oslo.i18n >=2.1.0 _P = _translators.plural_form def get_available_languages() -> list[str]: return oslo_i18n.get_available_languages(DOMAIN) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/common_checks.py0000664000175000017500000000366115133405522022674 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from oslo_config import cfg # type: ignore from oslo_policy import opts as policy_opts # type: ignore from oslo_utils import fileutils from oslo_upgradecheck import upgradecheck """ Common checks which can be used by multiple services. """ def check_policy_json( self: upgradecheck.UpgradeCommands, conf: cfg.ConfigOpts ) -> upgradecheck.Result: "Checks to see if policy file is JSON-formatted policy file." # NOTE(gmann): This method need [oslo_policy].policy_file # config value so register those options in case they # are not register by services. conf.register_opts(policy_opts._options, group=policy_opts._option_group) msg = ( "Your policy file is JSON-formatted which is " "deprecated. You need to switch to YAML-formatted file. " "Use the ``oslopolicy-convert-json-to-yaml`` " "tool to convert the existing JSON-formatted files to " "YAML in a backwards-compatible manner: " "https://docs.openstack.org/oslo.policy/" "latest/cli/oslopolicy-convert-json-to-yaml.html." ) status = upgradecheck.Result(upgradecheck.Code.SUCCESS) # Check if policy file exist and is JSON-formatted. policy_path = conf.find_file(conf.oslo_policy.policy_file) if policy_path and fileutils.is_json(policy_path): status = upgradecheck.Result(upgradecheck.Code.FAILURE, msg) return status ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/py.typed0000664000175000017500000000000015133405522021171 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3567657 oslo_upgradecheck-2.7.0/oslo_upgradecheck/tests/0000775000175000017500000000000015133405611020645 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/tests/__init__.py0000664000175000017500000000000015133405522022745 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/tests/test_common_checks.py0000664000175000017500000000763115133405522025076 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import fixtures import os.path import tempfile import yaml from oslo_config import cfg # type: ignore from oslo_config import fixture as config from oslo_policy import opts as policy_opts # type: ignore from oslo_serialization import jsonutils # type: ignore from oslotest import base # type: ignore from oslo_upgradecheck import common_checks from oslo_upgradecheck import upgradecheck class TestUpgradeCheckPolicyJSON(base.BaseTestCase): def setUp(self): super().setUp() conf_fixture = self.useFixture(config.Config()) conf_fixture.load_raw_values() self.conf = conf_fixture.conf self.conf.register_opts( policy_opts._options, group=policy_opts._option_group ) self.cmd = upgradecheck.UpgradeCommands() self.cmd._upgrade_checks = ( ( 'Policy File JSON to YAML Migration', (common_checks.check_policy_json, {'conf': self.conf}), ), ) self.data = {'rule_admin': 'True', 'rule_admin2': 'is_admin:True'} self.temp_dir = self.useFixture(fixtures.TempDir()) fd, self.json_file = tempfile.mkstemp(dir=self.temp_dir.path) fd, self.yaml_file = tempfile.mkstemp(dir=self.temp_dir.path) with open(self.json_file, 'w') as fh: jsonutils.dump(self.data, fh) with open(self.yaml_file, 'w') as fh: yaml.dump(self.data, fh) original_search_dirs = cfg._search_dirs def fake_search_dirs(dirs, name): dirs.append(self.temp_dir.path) return original_search_dirs(dirs, name) mock_search_dir = self.useFixture( fixtures.MockPatch('oslo_config.cfg._search_dirs') ).mock mock_search_dir.side_effect = fake_search_dirs def test_policy_json_file_fail_upgrade(self): # Test with policy json file full path set in config. self.conf.set_override( 'policy_file', self.json_file, group="oslo_policy" ) self.assertEqual(upgradecheck.Code.FAILURE, self.cmd.check()) def test_policy_yaml_file_pass_upgrade(self): # Test with full policy yaml file path set in config. self.conf.set_override( 'policy_file', self.yaml_file, group="oslo_policy" ) self.assertEqual(upgradecheck.Code.SUCCESS, self.cmd.check()) def test_no_policy_file_pass_upgrade(self): # Test with no policy file exist, means use policy from code. self.conf.set_override( 'policy_file', 'non_exist_file', group="oslo_policy" ) self.assertEqual(upgradecheck.Code.SUCCESS, self.cmd.check()) def test_default_policy_yaml_file_pass_upgrade(self): self.conf.set_override( 'policy_file', 'policy.yaml', group="oslo_policy" ) tmpfilename = os.path.join(self.temp_dir.path, 'policy.yaml') with open(tmpfilename, 'w') as fh: yaml.dump(self.data, fh) self.assertEqual(upgradecheck.Code.SUCCESS, self.cmd.check()) def test_old_default_policy_json_file_fail_upgrade(self): self.conf.set_override( 'policy_file', 'policy.json', group="oslo_policy" ) tmpfilename = os.path.join(self.temp_dir.path, 'policy.json') with open(tmpfilename, 'w') as fh: jsonutils.dump(self.data, fh) self.assertEqual(upgradecheck.Code.FAILURE, self.cmd.check()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/tests/test_upgradecheck.py0000664000175000017500000000677115133405522024717 0ustar00zuulzuul# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ test_upgradecheck ---------------------------------- Tests for `upgradecheck` module. """ import os.path import subprocess import sys from unittest import mock from oslo_config import cfg # type: ignore from oslotest import base # type: ignore from oslo_upgradecheck import upgradecheck class TestUpgradeCheckResult(base.BaseTestCase): def test_details(self): result = upgradecheck.Result(upgradecheck.Code.SUCCESS, 'test details') self.assertEqual(0, result.code) self.assertEqual('test details', result.details) class TestCommands(upgradecheck.UpgradeCommands): def success(self): return upgradecheck.Result( upgradecheck.Code.SUCCESS, 'Always succeeds' ) def warning(self): return upgradecheck.Result(upgradecheck.Code.WARNING, 'Always warns') def failure(self): return upgradecheck.Result(upgradecheck.Code.FAILURE, 'Always fails') _upgrade_checks = ( ('always succeeds', success), ('always warns', warning), ('always fails', failure), ) class SuccessCommands(upgradecheck.UpgradeCommands): def success(self): return upgradecheck.Result( upgradecheck.Code.SUCCESS, 'Always succeeds' ) _upgrade_checks = (('always succeeds', success),) class TestUpgradeCommands(base.BaseTestCase): def test_get_details(self): result = upgradecheck.Result(upgradecheck.Code.SUCCESS, '*' * 70) upgrade_commands = upgradecheck.UpgradeCommands() details = upgrade_commands._get_details(result) wrapped = '*' * 60 + '\n ' + '*' * 10 self.assertEqual(wrapped, details) def test_check(self): inst = TestCommands() result = inst.check() self.assertEqual(upgradecheck.Code.FAILURE, result) class TestMain(base.BaseTestCase): def _run_test(self, upgrade_command, expected): conf = cfg.ConfigOpts() result = upgradecheck.main( conf=conf, project='oslo-upgradecheck-test', upgrade_command=upgrade_command, argv=['upgrade', 'check'], ) self.assertEqual(expected, result) def test_main(self): inst = TestCommands() self._run_test(inst, upgradecheck.Code.FAILURE) def test_main_exception(self): raises = mock.Mock() raises.check.side_effect = Exception('test exception') self._run_test(raises, 255) def test_main_success(self): inst = SuccessCommands() self._run_test(inst, 0) class TestExampleFile(base.BaseTestCase): def test_example_main(self): path = os.path.join( os.path.dirname(os.path.abspath(__file__)), '../../doc/source/main.py', ) # The example includes both a passing and failing test, which means the # overall result is failure. self.assertEqual( upgradecheck.Code.FAILURE, subprocess.call([sys.executable, path, 'upgrade', 'check']), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/oslo_upgradecheck/upgradecheck.py0000664000175000017500000002232615133405522022510 0ustar00zuulzuul# Copyright 2018 Red Hat Inc. # Copyright 2016 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from collections.abc import Callable, Iterable import json import sys import textwrap import traceback from typing import Any, TypedDict import enum from oslo_config import cfg # type: ignore import prettytable from oslo_upgradecheck._i18n import _ CONF: cfg.ConfigOpts | None = None class Code(enum.IntEnum): """Status codes for the upgrade check command""" # All upgrade readiness checks passed successfully and there is # nothing to do. SUCCESS = 0 # At least one check encountered an issue and requires further # investigation. This is considered a warning but the upgrade may be OK. WARNING = 1 # There was an upgrade status check failure that needs to be # investigated. This should be considered something that stops an upgrade. FAILURE = 2 UPGRADE_CHECK_MSG_MAP = { Code.SUCCESS: _('Success'), Code.WARNING: _('Warning'), Code.FAILURE: _('Failure'), } class Result: """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. """ def __init__(self, code: Code, details: str | None = None) -> None: super().__init__() self.code = code self.details = details class _OutputCheck(TypedDict): check: str result: Code details: str | None class _Output(TypedDict): name: str checks: list[_OutputCheck] class 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. """ display_title = _('Upgrade Check Results') _upgrade_checks: tuple[ tuple[ str, Callable[..., Result] | tuple[Callable[..., Result], dict[str, Any]], ], ..., ] = () def _get_details(self, upgrade_check_result: Result) -> str | None: if upgrade_check_result.details is None: return None # wrap the text on the details to 60 characters return '\n'.join( textwrap.wrap( upgrade_check_result.details, 60, subsequent_indent=' ' ) ) def check(self) -> 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 """ return_code = Code.SUCCESS # This is a list if 2-item tuples for the check name and it's results. check_results = [] for name, func in self._upgrade_checks: if isinstance(func, tuple): func_name, kwargs = func result = func_name(self, **kwargs) else: result = func(self) # store the result of the check for the summary table check_results.append((name, result)) # we want to end up with the highest level code of all checks if result.code > return_code: return_code = result.code # We're going to build a summary table that looks like: # +----------------------------------------------------+ # | Upgrade Check Results | # +----------------------------------------------------+ # | Check: Cells v2 | # | Result: Success | # | Details: None | # +----------------------------------------------------+ # | Check: Placement API | # | Result: Failure | # | Details: There is no placement-api endpoint in the | # | service catalog. | # +----------------------------------------------------+ # Since registering opts can be overridden by consuming code, we can't # assume that our locally defined option exists. if ( CONF is not None and hasattr(CONF, 'command') and hasattr(CONF.command, 'json') and CONF.command.json ): # NOTE(bnemec): We use str on the translated string to # force immediate translation if lazy translation is in use. # See lp1801761 for details. output: _Output = {'name': str(self.display_title), 'checks': []} for name, result in check_results: output['checks'].append( { 'check': name, 'result': result.code, 'details': result.details, } ) print(json.dumps(output)) else: # NOTE(bnemec): We use str on the translated string to # force immediate translation if lazy translation is in use. # See lp1801761 for details. t = prettytable.PrettyTable( [str(self.display_title)], hrules=prettytable.ALL ) t.align = 'l' for name, result in check_results: cell = _( 'Check: %(name)s\nResult: %(result)s\nDetails: %(details)s' ) % { 'name': name, 'result': UPGRADE_CHECK_MSG_MAP[result.code], 'details': self._get_details(result), } t.add_row([cell]) print(t) return return_code def register_cli_options( conf: cfg.ConfigOpts, upgrade_command: UpgradeCommands ) -> None: """Set up the command line options. Adds a subcommand to support 'upgrade check' on the command line. :param conf: An oslo.confg ConfigOpts instance on which to register the upgrade check arguments. :param upgrade_command: The UpgradeCommands instance. """ def add_parsers(subparsers: Any) -> None: upgrade_action = subparsers.add_parser('upgrade') upgrade_action.add_argument('check') upgrade_action.set_defaults(action_fn=upgrade_command.check) upgrade_action.add_argument( '--json', action='store_true', help='Output the results in JSON format. Default is to print ' 'results in human readable table format.', ) opt = cfg.SubCommandOpt('command', handler=add_parsers) conf.register_cli_opt(opt) def run(conf: cfg.ConfigOpts) -> int: """Run the requested command. :param conf: An oslo.confg ConfigOpts instance on which the upgrade commands have been previously registered. """ try: return conf.command.action_fn() # type: ignore except Exception: print(_('Error:\n%s') % traceback.format_exc()) # This is 255 so it's not confused with the upgrade check exit codes. return 255 def main( conf: cfg.ConfigOpts, project: str, upgrade_command: UpgradeCommands, argv: list[str] = sys.argv[1:], 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. :param conf: An oslo.confg ConfigOpts instance on which to register the upgrade check arguments. :param project: The name of the project, to be used as an argument to the oslo_config.ConfigOpts instance to find configuration files. :param upgrade_command: The UpgradeCommands instance. :param argv: The command line arguments to parse. Defaults to sys.argv[1:]. :param 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. """ global CONF register_cli_options(conf, upgrade_command) conf(args=argv, project=project, default_config_files=default_config_files) CONF = conf return run(conf) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/pyproject.toml0000664000175000017500000000345115133405522016742 0ustar00zuulzuul[build-system] requires = ["pbr>=6.1.1"] build-backend = "pbr.build" [project] name = "oslo.upgradecheck" description = "Common code for writing OpenStack upgrade checks" authors = [ {name = "OpenStack", email = "openstack-discuss@lists.openstack.org"}, ] readme = {file = "README.rst", content-type = "text/x-rst"} license = {text = "Apache-2.0"} dynamic = ["version", "dependencies"] requires-python = ">=3.10" classifiers = [ "Environment :: OpenStack", "Intended Audience :: Information Technology", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ] [project.urls] Homepage = "https://docs.openstack.org/oslo.upgradecheck" Repository = "https://opendev.org/openstack/oslo.upgradecheck" [tool.setuptools] packages = [ "oslo_upgradecheck" ] [tool.mypy] python_version = "3.10" show_column_numbers = true show_error_context = true strict = true exclude = '(?x)(doc | examples | releasenotes)' [[tool.mypy.overrides]] module = ["oslo_upgradecheck.tests.*"] disallow_untyped_calls = false disallow_untyped_defs = false disallow_subclassing_any = false disallow_any_generics = false [tool.ruff] line-length = 79 [tool.ruff.lint] select = ["C4", "E4", "E5", "E7", "E9", "F", "G", "LOG", "S", "UP"] ignore = [ # we only use asserts for type narrowing "S101", ] [tool.ruff.lint.per-file-ignores] "oslo_upgradecheck/tests/*" = ["S"] [tool.ruff.format] quote-style = "preserve" docstring-code-format = true skip-magic-trailing-comma = true ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3427632 oslo_upgradecheck-2.7.0/releasenotes/0000775000175000017500000000000015133405611016513 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1768819593.357766 oslo_upgradecheck-2.7.0/releasenotes/notes/0000775000175000017500000000000015133405611017643 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/notes/drop-python27-support-bd23b9c4556739ba.yaml0000664000175000017500000000017715133405522027123 0ustar00zuulzuul--- upgrade: - | Support for Python 2.7 has been dropped. The minimum version of Python now supported is Python 3.6. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/notes/json-output-78a9e19588b7b1e1.yaml0000664000175000017500000000041515133405522025213 0ustar00zuulzuul--- features: - | oslo.upgradecheck now supports the command line flag ``--json`` to have the upgrade check results output in a compact, machine readable JSON format. The default output without this flag remains a human readable table of the results. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/notes/remove-py38-3c732ccf72eb235c.yaml0000664000175000017500000000016615133405522025121 0ustar00zuulzuul--- upgrade: - | Support for Python 3.8 has been removed. Now the minimum python version supported is 3.9 . ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/notes/remove-py39-436fc297a6611ad2.yaml0000664000175000017500000000016615133405522024765 0ustar00zuulzuul--- upgrade: - | Support for Python 3.9 has been removed. Now the minimum python version supported is 3.10. ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3617666 oslo_upgradecheck-2.7.0/releasenotes/source/0000775000175000017500000000000015133405611020013 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/2023.1.rst0000664000175000017500000000021015133405522021264 0ustar00zuulzuul=========================== 2023.1 Series Release Notes =========================== .. release-notes:: :branch: unmaintained/2023.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/2023.2.rst0000664000175000017500000000020215133405522021266 0ustar00zuulzuul=========================== 2023.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2023.2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/2024.1.rst0000664000175000017500000000021015133405522021265 0ustar00zuulzuul=========================== 2024.1 Series Release Notes =========================== .. release-notes:: :branch: unmaintained/2024.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/2024.2.rst0000664000175000017500000000020215133405522021267 0ustar00zuulzuul=========================== 2024.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2024.2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/2025.1.rst0000664000175000017500000000020215133405522021267 0ustar00zuulzuul=========================== 2025.1 Series Release Notes =========================== .. release-notes:: :branch: stable/2025.1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/2025.2.rst0000664000175000017500000000020215133405522021270 0ustar00zuulzuul=========================== 2025.2 Series Release Notes =========================== .. release-notes:: :branch: stable/2025.2 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3617666 oslo_upgradecheck-2.7.0/releasenotes/source/_static/0000775000175000017500000000000015133405611021441 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/_static/.placeholder0000664000175000017500000000000015133405522023713 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1768819593.3617666 oslo_upgradecheck-2.7.0/releasenotes/source/_templates/0000775000175000017500000000000015133405611022150 5ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/_templates/.placeholder0000664000175000017500000000000015133405522024422 0ustar00zuulzuul././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/conf.py0000664000175000017500000000310115133405522021306 0ustar00zuulzuul# Copyright (C) 2020 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Project information ----------------------------------------------------- copyright = '2018, Oslo Contributors' author = 'Oslo Contributors' # The short X.Y version version = '' # The full version, including alpha/beta/rc tags release = '' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['reno.sphinxext', 'openstackdocstheme'] # The master toctree document. master_doc = 'index' # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'openstackdocs' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/index.rst0000664000175000017500000000036315133405522021657 0ustar00zuulzuuloslo.upgradecheck Release Notes =============================== .. toctree:: :maxdepth: 1 unreleased 2025.2 2025.1 2024.2 2024.1 2023.2 2023.1 zed yoga xena wallaby victoria ussuri train stein ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/stein.rst0000664000175000017500000000022115133405522021663 0ustar00zuulzuul=================================== Stein Series Release Notes =================================== .. release-notes:: :branch: stable/stein ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/train.rst0000664000175000017500000000017615133405522021667 0ustar00zuulzuul========================== Train Series Release Notes ========================== .. release-notes:: :branch: stable/train ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/unreleased.rst0000664000175000017500000000016015133405522022672 0ustar00zuulzuul============================== Current Series Release Notes ============================== .. release-notes:: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/ussuri.rst0000664000175000017500000000020215133405522022072 0ustar00zuulzuul=========================== Ussuri Series Release Notes =========================== .. release-notes:: :branch: stable/ussuri ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/victoria.rst0000664000175000017500000000022015133405522022360 0ustar00zuulzuul============================= Victoria Series Release Notes ============================= .. release-notes:: :branch: unmaintained/victoria ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/wallaby.rst0000664000175000017500000000021415133405522022176 0ustar00zuulzuul============================ Wallaby Series Release Notes ============================ .. release-notes:: :branch: unmaintained/wallaby ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/xena.rst0000664000175000017500000000020015133405522021471 0ustar00zuulzuul========================= Xena Series Release Notes ========================= .. release-notes:: :branch: unmaintained/xena ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/yoga.rst0000664000175000017500000000020015133405522021475 0ustar00zuulzuul========================= Yoga Series Release Notes ========================= .. release-notes:: :branch: unmaintained/yoga ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/releasenotes/source/zed.rst0000664000175000017500000000017415133405522021332 0ustar00zuulzuul======================== Zed Series Release Notes ======================== .. release-notes:: :branch: unmaintained/zed ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/requirements.txt0000664000175000017500000000057215133405522017313 0ustar00zuulzuul# Requirements lower bounds listed here are our best effort to keep them up to # date but we do not test them so no guarantee of having them all correct. If # you find any incorrect lower bounds, let us know or propose a fix. oslo.config>=5.2.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 PrettyTable>=0.7.1 # BSD oslo.utils>=4.5.0 # Apache-2.0 oslo.policy>=2.0.0 # Apache-2.0 ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1768819593.363767 oslo_upgradecheck-2.7.0/setup.cfg0000664000175000017500000000011315133405611015636 0ustar00zuulzuul[metadata] name = oslo.upgradecheck [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/setup.py0000664000175000017500000000125115133405522015534 0ustar00zuulzuul# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. import setuptools setuptools.setup(setup_requires=['pbr'], pbr=True) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/test-requirements.txt0000664000175000017500000000010615133405522020261 0ustar00zuulzuuloslotest>=3.5.0 stestr>=2.0.0 oslo.serialization>=2.21.1 # Apache-2.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1768819538.0 oslo_upgradecheck-2.7.0/tox.ini0000664000175000017500000000356515133405522015347 0ustar00zuulzuul[tox] minversion = 3.18.0 envlist = py3,pep8 [testenv] usedevelop = True setenv = OS_DEBUG=1 OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = stestr run --slowest {posargs} [testenv:pep8] description = Run style checks. skip_install = true deps = pre-commit {[testenv:mypy]deps} commands = pre-commit run -a {[testenv:mypy]commands} [testenv:mypy] description = Run type checks. deps = {[testenv]deps} mypy types-PyYAML commands = mypy --cache-dir="{envdir}/mypy_cache" {posargs:oslo_upgradecheck} [testenv:venv] commands = {posargs} [testenv:cover] deps = {[testenv]deps} coverage setenv = PYTHON=coverage run --source oslo_upgradecheck --parallel-mode commands = coverage erase stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report --show-missing [testenv:docs] allowlist_externals = rm deps = {[testenv]deps} -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build sphinx-build -W --keep-going -b html doc/source doc/build/html [testenv:releasenotes] deps = {[testenv:docs]deps} allowlist_externals = rm commands = rm -rf releasenotes/build sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html [testenv:debug] commands = oslo_debug_helper {posargs} [flake8] # We only enable the hacking (H) checks select = H # H301 Black will put commas after imports that can't fit on one line # H404 Docstrings don't always start with a newline # H405 Multiline docstrings are okay ignore = H301,H403,H404,H405 show-source = True exclude = .venv,.git,.tox,dist,doc,releasenotes,*lib/python*,*egg,build [hacking] import_exception = oslo_upgradecheck._i18n