Bridge between container framework networking and storage models to OpenStack networking and storage abstractions.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

status.py 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright (c) 2018 NEC, Corp.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  4. # not use this file except in compliance with the License. You may obtain
  5. # a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  11. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  12. # License for the specific language governing permissions and limitations
  13. # under the License.
  14. import sys
  15. from oslo_config import cfg
  16. from oslo_upgradecheck import upgradecheck
  17. from kuryr.lib._i18n import _
  18. class Checks(upgradecheck.UpgradeCommands):
  19. """Upgrade checks for the kuryr-status upgrade check command
  20. Upgrade checks should be added as separate methods in this class
  21. and added to _upgrade_checks tuple.
  22. """
  23. def _check_placeholder(self):
  24. # This is just a placeholder for upgrade checks, it should be
  25. # removed when the actual checks are added
  26. return upgradecheck.Result(upgradecheck.Code.SUCCESS)
  27. # The format of the check functions is to return an
  28. # oslo_upgradecheck.upgradecheck.Result
  29. # object with the appropriate
  30. # oslo_upgradecheck.upgradecheck.Code and details set.
  31. # If the check hits warnings or failures then those should be stored
  32. # in the returned Result's "details" attribute. The
  33. # summary will be rolled up at the end of the check() method.
  34. _upgrade_checks = (
  35. # In the future there should be some real checks added here
  36. (_('Placeholder'), _check_placeholder),
  37. )
  38. def main():
  39. return upgradecheck.main(
  40. cfg.CONF, project='kuryr', upgrade_command=Checks())
  41. if __name__ == '__main__':
  42. sys.exit(main())