diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9d945567450344fa94ec9e6280095e86a6c532b0 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,35 @@ +# We from the Oslo project decided to pin repos based on the +# commit hash instead of the version tag to prevend arbitrary +# code from running in developer's machines. To update to a +# newer version, run `pre-commit autoupdate` and then replace +# the newer versions with their commit hash. + +default_language_version: + python: python3 + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: ebc15addedad713c86ef18ae9632c88e187dd0af # v3.1.0 + hooks: + - id: trailing-whitespace + # Replaces or checks mixed line ending + - id: mixed-line-ending + args: ['--fix', 'lf'] + exclude: '.*\.(svg)$' + # Forbid files which have a UTF-8 byte-order marker + - id: check-byte-order-marker + # Checks that non-binary executables have a proper shebang + - id: check-executables-have-shebangs + # Check for files that contain merge conflict strings. + - id: check-merge-conflict + # Check for debugger imports and py37+ breakpoint() + # calls in python source + - id: debug-statements + - id: check-yaml + files: .*\.(yaml|yml)$ + - repo: https://gitlab.com/pycqa/flake8 + rev: 181bb46098dddf7e2d45319ea654b4b4d58c2840 # 3.8.3 + hooks: + - id: flake8 + additional_dependencies: + - hacking>=3.0.1,<3.1.0 diff --git a/.zuul.yaml b/.zuul.yaml index 600de85c6564ba5b37b52d4139fd3f67ee44e600..4b91294604099d0b98908e60d2e9aa701ec0b2c3 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -6,7 +6,7 @@ - check-requirements - lib-forward-testing-python3 - openstack-lower-constraints-jobs - - openstack-python3-victoria-jobs + - openstack-python3-wallaby-jobs - periodic-stable-jobs - publish-openstack-docs-pti - release-notes-jobs-python3 diff --git a/doc/source/conf.py b/doc/source/conf.py index 92897ead9e26513afaa9a7473b478e96c39d4f53..834bf69a1521c6a738547db1070961656cee7287 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +# 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 @@ -85,6 +87,3 @@ latex_documents = [ u'%s Documentation' % project, u'OpenStack Foundation', 'manual'), ] - -# Example configuration for intersphinx: refer to the Python standard library. -#intersphinx_mapping = {'http://docs.python.org/': None} diff --git a/lower-constraints.txt b/lower-constraints.txt index a1e990d173537e690e05bf8d358b607beb92f2f6..4d20032f59221121c29d3f51eafdcc7f97a33b0d 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -35,7 +35,7 @@ oslo.messaging==5.29.0 oslo.middleware==3.31.0 oslo.serialization==2.18.0 oslo.service==1.24.0 -oslo.utils==3.33.0 +oslo.utils==4.7.0 oslotest==3.2.0 Paste==2.0.2 PasteDeploy==1.5.0 diff --git a/oslo_versionedobjects/fixture.py b/oslo_versionedobjects/fixture.py index 960146b357da5843101cafb7afceeb1361547556..9661c70e6644af46cb4f4ccff1db177768be0e71 100644 --- a/oslo_versionedobjects/fixture.py +++ b/oslo_versionedobjects/fixture.py @@ -24,12 +24,12 @@ from collections import namedtuple from collections import OrderedDict import copy import datetime -import hashlib import inspect import logging from unittest import mock import fixtures +from oslo_utils.secretutils import md5 from oslo_utils import versionutils as vutils from oslo_versionedobjects import base @@ -271,8 +271,9 @@ class ObjectVersionChecker(object): if extra_data_func: relevant_data += extra_data_func(obj_class) - fingerprint = '%s-%s' % (obj_class.VERSION, hashlib.md5( - bytes(repr(relevant_data).encode())).hexdigest()) + fingerprint = '%s-%s' % (obj_class.VERSION, md5( + bytes(repr(relevant_data).encode()), + usedforsecurity=False).hexdigest()) return fingerprint def get_hashes(self, extra_data_func=None): diff --git a/releasenotes/notes/update_md5_for_fips-e5a8f8f438ac81fb.yaml b/releasenotes/notes/update_md5_for_fips-e5a8f8f438ac81fb.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fadd096e2fe45ff99a76cc7387c5d1e7d5750662 --- /dev/null +++ b/releasenotes/notes/update_md5_for_fips-e5a8f8f438ac81fb.yaml @@ -0,0 +1,4 @@ +--- +features: + - Updated _get_fingerprint to use new oslo.utils encapsulation of md5 to + allow md5 hashes to be returned on a FIPS enabled system. diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst index 84e055bf74e0c0cec756a27503172a4b4d8a4fb7..474f7eb4e55a0b691a91b844252984c829f81668 100644 --- a/releasenotes/source/index.rst +++ b/releasenotes/source/index.rst @@ -6,6 +6,7 @@ :maxdepth: 1 unreleased + victoria ussuri train stein diff --git a/releasenotes/source/victoria.rst b/releasenotes/source/victoria.rst new file mode 100644 index 0000000000000000000000000000000000000000..4efc7b6f3b1117aae27fed2a9a8a9f7cadc7af8b --- /dev/null +++ b/releasenotes/source/victoria.rst @@ -0,0 +1,6 @@ +============================= +Victoria Series Release Notes +============================= + +.. release-notes:: + :branch: stable/victoria diff --git a/requirements.txt b/requirements.txt index 8eb7ca53895bc5c50f7b37d5e0d1a4158f851b8d..1235e45503c5c8ef6f0784ff88f741574e48553d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ oslo.config>=5.2.0 # Apache-2.0 oslo.context>=2.19.2 # Apache-2.0 oslo.messaging>=5.29.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 -oslo.utils>=3.33.0 # Apache-2.0 +oslo.utils>=4.7.0 # Apache-2.0 iso8601>=0.1.11 # MIT oslo.log>=3.36.0 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index ccb1dc6eac8c72df0607487836e6fd5717f5f251..6ba22a84adc79389de1582af9558c097d3ce06d4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,3 +12,5 @@ fixtures>=3.0.0 # Apache-2.0/BSD # Bandit security code scanner bandit>=1.6.0,<1.7.0 # Apache-2.0 + +pre-commit>=2.6.0 # MIT diff --git a/tox.ini b/tox.ini index 3e74520f8a536014c20c97d0dedf28b52836fe3b..7c6169b2f56a8eb5cb17728e22678ebf9e3ca53f 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ commands = stestr run --slowest {posargs} [testenv:pep8] commands = - flake8 + pre-commit run -a # Run security linter bandit -r oslo_versionedobjects tests -n5 --skip B303