Hello community, here is the log from the commit of package python-oslo.context for openSUSE:Factory checked in at 2018-01-17 21:56:48 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-oslo.context (Old) and /work/SRC/openSUSE:Factory/.python-oslo.context.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oslo.context" Wed Jan 17 21:56:48 2018 rev:9 rq:565790 version:2.20.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-oslo.context/python-oslo.context.changes 2017-08-28 15:32:32.715022293 +0200 +++ /work/SRC/openSUSE:Factory/.python-oslo.context.new/python-oslo.context.changes 2018-01-17 21:56:54.371165510 +0100 @@ -1,0 +2,19 @@ +Mon Jan 15 11:51:48 UTC 2018 - cloud-de...@suse.de + +- update to version 2.20.0 + - Remove -U from pip install + - Follow the new PTI for document build + - Update reno for stable/pike + - Remove use of positional decorator + - Remove setting of version/release from releasenotes + - Rename deprecated context params + - Update the documentation link for doc migration + - Revert "Postpone deprecation warnings to Pike" + - Ouput a placeholder instead of the auth_token + - Make from_dict extensible + - add bandit to pep8 job + - Output 'project' key in context's to_dict function + - Updated from global requirements + - Avoid tox_install.sh for constraints support + +------------------------------------------------------------------- Old: ---- oslo.context-2.17.0.tar.gz New: ---- oslo.context-2.20.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-oslo.context.spec ++++++ --- /var/tmp/diff_new_pack.I1aeEm/_old 2018-01-17 21:56:55.107131012 +0100 +++ /var/tmp/diff_new_pack.I1aeEm/_new 2018-01-17 21:56:55.111130825 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-oslo.context # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,26 +16,30 @@ # -%global sname oslo.context %bcond_without test Name: python-oslo.context -Version: 2.17.0 +Version: 2.20.0 Release: 0 Summary: OpenStack Oslo context library License: Apache-2.0 Group: Development/Languages/Python -Url: https://launchpad.net/%{sname} -Source0: https://pypi.io/packages/source/o/%{sname}/%{sname}-%{version}.tar.gz +Url: https://launchpad.net/oslo.context +Source0: https://files.pythonhosted.org/packages/source/o/oslo.context/oslo.context-2.20.0.tar.gz BuildRequires: openstack-macros -BuildRequires: python-pbr >= 2.0.0 -BuildRequires: python-positional >= 1.1.1 +BuildRequires: python2-pbr >= 2.0.0 +BuildRequires: python2-positional +BuildRequires: python3-pbr >= 2.0.0 +BuildRequires: python3-positional Requires: python-debtcollector >= 1.2.0 -Requires: python-positional >= 1.1.1 +Requires: python-positional BuildArch: noarch %if %{with test} -BuildRequires: python-debtcollector >= 1.2.0 -BuildRequires: python-oslotest >= 1.10.0 +BuildRequires: python2-debtcollector >= 1.2.0 +BuildRequires: python2-oslotest >= 1.10.0 +BuildRequires: python3-debtcollector >= 1.2.0 +BuildRequires: python3-oslotest >= 1.10.0 %endif +%python_subpackages %description The Oslo context library has helpers to maintain useful information @@ -43,43 +47,45 @@ The request context is usually populated in the WSGI pipeline and used by various modules such as logging. -%package doc +%package -n python-oslo.context-doc Summary: Documentation for OpenStack common context library -Group: Documentation +Group: Documentation/HTML BuildRequires: python-Sphinx -BuildRequires: python-openstackdocstheme >= 1.11.0 +BuildRequires: python-openstackdocstheme >= 1.17.0 -%description doc +%description -n python-oslo.context-doc Documentation for the oslo-context library. %prep -%autosetup -n %{sname}-%{version} +%autosetup -p1 -n oslo.context-2.20.0 %py_req_cleanup # without git, openstackdocstheme has warnings which let the doc build fail sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg %build -%{py2_build} +%{python_build} # generate html docs %{__python2} setup.py build_sphinx # remove the sphinx-build leftovers rm -rf doc/build/html/.{doctrees,buildinfo} %install -%{py2_install} +%{python_install} %if %{with test} %check -%{__python2} setup.py test +%{python_expand rm -rf .testrepository +$python setup.py testr +} %endif -%files +%files %{python_files} %license LICENSE %doc README.rst %{python2_sitelib}/oslo_context %{python2_sitelib}/*.egg-info -%files doc +%files -n python-oslo.context-doc %license LICENSE %doc doc/build/html ++++++ _service ++++++ --- /var/tmp/diff_new_pack.I1aeEm/_old 2018-01-17 21:56:55.143129325 +0100 +++ /var/tmp/diff_new_pack.I1aeEm/_new 2018-01-17 21:56:55.147129137 +0100 @@ -1,8 +1,8 @@ <services> <service mode="disabled" name="renderspec"> - <param name="input-template">https://raw.githubusercontent.com/openstack/rpm-packaging/stable/pike/openstack/oslo.context/oslo.context.spec.j2</param> + <param name="input-template">https://raw.githubusercontent.com/openstack/rpm-packaging/master/openstack/oslo.context/oslo.context.spec.j2</param> <param name="output-name">python-oslo.context.spec</param> - <param name="requirements">https://raw.githubusercontent.com/openstack/rpm-packaging/stable/pike/global-requirements.txt</param> + <param name="requirements">https://raw.githubusercontent.com/openstack/rpm-packaging/master/requirements.txt</param> <param name="changelog-email">cloud-de...@suse.de</param> <param name="changelog-provider">gh,openstack,oslo.context</param> </service> ++++++ oslo.context-2.17.0.tar.gz -> oslo.context-2.20.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/AUTHORS new/oslo.context-2.20.0/AUTHORS --- old/oslo.context-2.17.0/AUTHORS 2017-07-18 15:09:00.000000000 +0200 +++ new/oslo.context-2.20.0/AUTHORS 2018-01-08 15:14:14.000000000 +0100 @@ -3,6 +3,7 @@ Andreas Jaeger <a...@suse.com> Andrew Bogott <abog...@wikimedia.org> Atsushi SAKAI <sak...@jp.fujitsu.com> +Ben Nemec <bne...@redhat.com> ChangBo Guo(gcb) <eric....@easystack.cn> Cyril Roelandt <cyril.roela...@enovance.com> Davanum Srinivas (dims) <dava...@gmail.com> @@ -21,9 +22,11 @@ Joe Gordon <joe.gord...@gmail.com> Joshua Harlow <harlo...@yahoo-inc.com> Joshua Harlow <jxhar...@godaddy.com> +Juan Antonio Osorio Robles <jaosor...@redhat.com> Kirill Bespalov <kbespa...@mirantis.com> Michael Basnight <mbasni...@gmail.com> Monty Taylor <mord...@inaugust.com> +Morgan Fainberg <morgan.fainb...@gmail.com> OpenStack Release Bot <infra-r...@openstack.org> Ronald Bradford <ronald.bradf...@gmail.com> Sean Dague <s...@dague.net> @@ -36,6 +39,8 @@ Vu Cong Tuan <tua...@vn.fujitsu.com> Wei Li <wei...@easystack.cn> Zhongyue Luo <zhongyue....@intel.com> +Zuul <z...@review.openstack.org> +lingyongxu <l...@fiberhome.com> melissaml <ma....@99cloud.net> ricolin <rico....@easystack.cn> yanheven <yanhe...@qq.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/ChangeLog new/oslo.context-2.20.0/ChangeLog --- old/oslo.context-2.17.0/ChangeLog 2017-07-18 15:09:00.000000000 +0200 +++ new/oslo.context-2.20.0/ChangeLog 2018-01-08 15:14:14.000000000 +0100 @@ -1,6 +1,51 @@ CHANGES ======= +2.20.0 +------ + +* Updated from global requirements +* Follow the new PTI for document build +* Remove -U from pip install +* Avoid tox\_install.sh for constraints support +* add bandit to pep8 job +* Remove setting of version/release from releasenotes + +2.19.3 +------ + +* Ouput a placeholder instead of the auth\_token + +2.19.2 +------ + +* Make from\_dict extensible + +2.19.1 +------ + +* Output 'project' key in context's to\_dict function +* Rename deprecated context params + +2.19.0 +------ + +* Updated from global requirements + +2.18.1 +------ + +* Update the documentation link for doc migration +* Revert "Postpone deprecation warnings to Pike" + +2.18.0 +------ + +* Updated from global requirements +* Remove use of positional decorator +* Update reno for stable/pike +* Updated from global requirements + 2.17.0 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/PKG-INFO new/oslo.context-2.20.0/PKG-INFO --- old/oslo.context-2.17.0/PKG-INFO 2017-07-18 15:09:01.000000000 +0200 +++ new/oslo.context-2.20.0/PKG-INFO 2018-01-08 15:14:15.000000000 +0100 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: oslo.context -Version: 2.17.0 +Version: 2.20.0 Summary: Oslo Context library Home-page: https://docs.openstack.org/oslo.context/latest/ Author: OpenStack Author-email: openstack-...@lists.openstack.org License: UNKNOWN +Description-Content-Type: UNKNOWN Description: ==================== Oslo Context Library ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/doc/requirements.txt new/oslo.context-2.20.0/doc/requirements.txt --- old/oslo.context-2.17.0/doc/requirements.txt 1970-01-01 01:00:00.000000000 +0100 +++ new/oslo.context-2.20.0/doc/requirements.txt 2018-01-08 15:11:52.000000000 +0100 @@ -0,0 +1,8 @@ +# The order of packages is significant, because pip processes them in the order +# of appearance. Changing the order has an impact on the overall integration +# process, which may cause wedges in the gate later. +# These are needed for docs generation +openstackdocstheme>=1.17.0 # Apache-2.0 +sphinx>=1.6.2 # BSD +reno>=2.5.0 # Apache-2.0 +fixtures>=3.0.0 # Apache-2.0/BSD diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/doc/source/user/examples/usage_user_identity.py new/oslo.context-2.20.0/doc/source/user/examples/usage_user_identity.py --- old/oslo.context-2.17.0/doc/source/user/examples/usage_user_identity.py 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/doc/source/user/examples/usage_user_identity.py 2018-01-08 15:11:35.000000000 +0100 @@ -22,7 +22,7 @@ More information can be found at: - https://docs.openstack.org/developer/oslo.context/usage.html + https://docs.openstack.org/oslo.context/latest/user/index.html """ from oslo_config import cfg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/oslo.context.egg-info/PKG-INFO new/oslo.context-2.20.0/oslo.context.egg-info/PKG-INFO --- old/oslo.context-2.17.0/oslo.context.egg-info/PKG-INFO 2017-07-18 15:09:00.000000000 +0200 +++ new/oslo.context-2.20.0/oslo.context.egg-info/PKG-INFO 2018-01-08 15:14:14.000000000 +0100 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: oslo.context -Version: 2.17.0 +Version: 2.20.0 Summary: Oslo Context library Home-page: https://docs.openstack.org/oslo.context/latest/ Author: OpenStack Author-email: openstack-...@lists.openstack.org License: UNKNOWN +Description-Content-Type: UNKNOWN Description: ==================== Oslo Context Library ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/oslo.context.egg-info/SOURCES.txt new/oslo.context-2.20.0/oslo.context.egg-info/SOURCES.txt --- old/oslo.context-2.17.0/oslo.context.egg-info/SOURCES.txt 2017-07-18 15:09:01.000000000 +0200 +++ new/oslo.context-2.20.0/oslo.context.egg-info/SOURCES.txt 2018-01-08 15:14:15.000000000 +0100 @@ -13,6 +13,7 @@ setup.py test-requirements.txt tox.ini +doc/requirements.txt doc/source/conf.py doc/source/index.rst doc/source/contributor/index.rst @@ -42,11 +43,12 @@ oslo_context/tests/test_context.py oslo_context/tests/test_fixture.py releasenotes/notes/add_reno-3b4ae0789e9c45b4.yaml +releasenotes/notes/dont-leak-auth-token-fb7075316cf87b7c.yaml releasenotes/source/conf.py releasenotes/source/index.rst releasenotes/source/newton.rst releasenotes/source/ocata.rst +releasenotes/source/pike.rst releasenotes/source/unreleased.rst releasenotes/source/_static/.placeholder -releasenotes/source/_templates/.placeholder -tools/tox_install.sh \ No newline at end of file +releasenotes/source/_templates/.placeholder \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/oslo.context.egg-info/pbr.json new/oslo.context-2.20.0/oslo.context.egg-info/pbr.json --- old/oslo.context-2.17.0/oslo.context.egg-info/pbr.json 2017-07-18 15:09:00.000000000 +0200 +++ new/oslo.context-2.20.0/oslo.context.egg-info/pbr.json 2018-01-08 15:14:14.000000000 +0100 @@ -1 +1 @@ -{"git_version": "e86ee74", "is_release": true} \ No newline at end of file +{"git_version": "bfdeba6", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/oslo.context.egg-info/requires.txt new/oslo.context-2.20.0/oslo.context.egg-info/requires.txt --- old/oslo.context-2.17.0/oslo.context.egg-info/requires.txt 2017-07-18 15:09:00.000000000 +0200 +++ new/oslo.context-2.20.0/oslo.context.egg-info/requires.txt 2018-01-08 15:14:14.000000000 +0100 @@ -1,3 +1,2 @@ pbr!=2.1.0,>=2.0.0 debtcollector>=1.2.0 -positional>=1.1.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/oslo_context/context.py new/oslo.context-2.20.0/oslo_context/context.py --- old/oslo.context-2.17.0/oslo_context/context.py 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/oslo_context/context.py 2018-01-08 15:11:35.000000000 +0100 @@ -27,13 +27,15 @@ """ import collections +import functools import itertools import threading import uuid import warnings import debtcollector -from positional import positional +from debtcollector import renames + _request_store = threading.local() @@ -42,13 +44,13 @@ _ENVIRON_HEADERS = { 'auth_token': ['HTTP_X_AUTH_TOKEN', 'HTTP_X_STORAGE_TOKEN'], - 'user': ['HTTP_X_USER_ID', - 'HTTP_X_USER'], - 'tenant': ['HTTP_X_PROJECT_ID', - 'HTTP_X_TENANT_ID', - 'HTTP_X_TENANT'], - 'user_domain': ['HTTP_X_USER_DOMAIN_ID'], - 'project_domain': ['HTTP_X_PROJECT_DOMAIN_ID'], + 'user_id': ['HTTP_X_USER_ID', + 'HTTP_X_USER'], + 'project_id': ['HTTP_X_PROJECT_ID', + 'HTTP_X_TENANT_ID', + 'HTTP_X_TENANT'], + 'user_domain_id': ['HTTP_X_USER_DOMAIN_ID'], + 'project_domain_id': ['HTTP_X_PROJECT_DOMAIN_ID'], 'user_name': ['HTTP_X_USER_NAME'], 'project_name': ['HTTP_X_PROJECT_NAME', 'HTTP_X_TENANT_NAME'], @@ -131,22 +133,16 @@ return d -# FIXME(dims): Skip deprecation warnings until Pike (Version 2.14) -_log_deprecation_warnings = False - - def _moved_msg(new_name, old_name): if old_name: deprecated_msg = "Property '%(old_name)s' has moved to '%(new_name)s'" deprecated_msg = deprecated_msg % {'old_name': old_name, 'new_name': new_name} - # FIXME(dims): Skip deprecation warnings until Pike (Version 2.14) - if _log_deprecation_warnings: - debtcollector.deprecate(deprecated_msg, - version='2.6', - removal_version='3.0', - stacklevel=5) + debtcollector.deprecate(deprecated_msg, + version='2.6', + removal_version='3.0', + stacklevel=5) def _moved_property(new_name, old_name=None, target=None): @@ -169,6 +165,12 @@ return property(getter, setter, deleter) +_renamed_kwarg = functools.partial(renames.renamed_kwarg, + version='2.18', + removal_version='3.0', + replace=True) + + class RequestContext(object): """Helper class to represent useful information about a request context. @@ -178,15 +180,22 @@ """ user_idt_format = u'{user} {tenant} {domain} {user_domain} {p_domain}' - - @positional(enforcement=positional.WARN) + # Can be overridden in subclasses to specify extra keys that should be + # read when constructing a context using from_dict. + FROM_DICT_EXTRA_KEYS = [] + + @_renamed_kwarg('user', 'user_id') + @_renamed_kwarg('tenant', 'project_id') + @_renamed_kwarg('domain', 'domain_id') + @_renamed_kwarg('user_domain', 'user_domain_id') + @_renamed_kwarg('project_domain', 'project_domain_id') def __init__(self, auth_token=None, - user=None, - tenant=None, - domain=None, - user_domain=None, - project_domain=None, + user_id=None, + project_id=None, + domain_id=None, + user_domain_id=None, + project_domain_id=None, is_admin=False, read_only=False, show_deleted=False, @@ -221,11 +230,11 @@ :type is_admin_project: bool """ # setting to private variables to avoid triggering subclass properties - self._user_id = user - self._project_id = tenant - self._domain_id = domain - self._user_domain_id = user_domain - self._project_domain_id = project_domain + self._user_id = user_id + self._project_id = project_id + self._domain_id = domain_id + self._user_domain_id = user_domain_id + self._project_domain_id = project_domain_id self.auth_token = auth_token self.user_name = user_name @@ -321,6 +330,7 @@ return {'user': self.user_id, 'tenant': self.project_id, + 'project': self.project_id, 'domain': self.domain_id, 'user_domain': self.user_domain_id, 'project_domain': self.project_domain_id, @@ -343,6 +353,13 @@ 'user_domain_name': self.user_domain_name, 'project_domain_name': self.project_domain_name} values.update(self.to_dict()) + if self.auth_token: + # NOTE(jaosorior): Gotta obfuscate the token since this dict is + # meant for logging and we shouldn't leak it. + values['auth_token'] = '***' + else: + values['auth_token'] = None + return values @property @@ -356,14 +373,19 @@ return self.global_request_id or self.request_id @classmethod + @_renamed_kwarg('user', 'user_id') + @_renamed_kwarg('tenant', 'project_id') + @_renamed_kwarg('domain', 'domain_id') + @_renamed_kwarg('user_domain', 'user_domain_id') + @_renamed_kwarg('project_domain', 'project_domain_id') def from_dict(cls, values, **kwargs): """Construct a context object from a provided dictionary.""" kwargs.setdefault('auth_token', values.get('auth_token')) - kwargs.setdefault('user', values.get('user')) - kwargs.setdefault('tenant', values.get('tenant')) - kwargs.setdefault('domain', values.get('domain')) - kwargs.setdefault('user_domain', values.get('user_domain')) - kwargs.setdefault('project_domain', values.get('project_domain')) + kwargs.setdefault('user_id', values.get('user')) + kwargs.setdefault('project_id', values.get('tenant')) + kwargs.setdefault('domain_id', values.get('domain')) + kwargs.setdefault('user_domain_id', values.get('user_domain')) + kwargs.setdefault('project_domain_id', values.get('project_domain')) kwargs.setdefault('is_admin', values.get('is_admin', False)) kwargs.setdefault('read_only', values.get('read_only', False)) kwargs.setdefault('show_deleted', values.get('show_deleted', False)) @@ -379,9 +401,16 @@ values.get('project_domain_name')) kwargs.setdefault('is_admin_project', values.get('is_admin_project', True)) + for key in cls.FROM_DICT_EXTRA_KEYS: + kwargs.setdefault(key, values.get(key)) return cls(**kwargs) @classmethod + @_renamed_kwarg('user', 'user_id') + @_renamed_kwarg('tenant', 'project_id') + @_renamed_kwarg('domain', 'domain_id') + @_renamed_kwarg('user_domain', 'user_domain_id') + @_renamed_kwarg('project_domain', 'project_domain_id') def from_environ(cls, environ, **kwargs): """Load a context object from a request environment. @@ -428,7 +457,7 @@ def get_admin_context(show_deleted=False): """Create an administrator context.""" context = RequestContext(None, - tenant=None, + project_id=None, is_admin=True, show_deleted=show_deleted, overwrite=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/oslo_context/tests/test_context.py new/oslo.context-2.20.0/oslo_context/tests/test_context.py --- old/oslo.context-2.17.0/oslo_context/tests/test_context.py 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/oslo_context/tests/test_context.py 2018-01-08 15:11:35.000000000 +0100 @@ -54,6 +54,24 @@ pass +class TestContext(context.RequestContext): + """A test context with additional members + + This is representative of how at least some of our consumers use the + RequestContext class in their projects. + """ + FROM_DICT_EXTRA_KEYS = ['foo'] + + def __init__(self, foo=None, **kwargs): + super(TestContext, self).__init__(**kwargs) + self.foo = foo + + def to_dict(self): + d = super(TestContext, self).to_dict() + d['foo'] = self.foo + return d + + class ContextTest(test_base.BaseTestCase): def setUp(self): @@ -182,6 +200,13 @@ self.assertFalse(ctx.is_admin) self.assertTrue(ctx.read_only) + def test_from_dict_extended(self): + initial = TestContext(foo='bar') + dct = initial.to_dict() + final = TestContext.from_dict(dct) + self.assertEqual('bar', final.foo) + self.assertEqual(dct, final.to_dict()) + def test_is_user_context(self): self.assertFalse(context.is_user_context(None)) ctx = context.RequestContext(is_admin=True) @@ -461,6 +486,7 @@ d = ctx.get_logging_values() self.assertIn('auth_token', d) + self.assertEqual(d['auth_token'], '***') self.assertIn('user', d) self.assertIn('tenant', d) self.assertIn('domain', d) @@ -562,13 +588,6 @@ 'service_roles': service_roles}, ctx.to_policy_values()) - def test_positional_args(self): - context.RequestContext('abc', 'def') - - self.assertEqual(1, len(self.warnings.log)) - self.assertIn('__init__ takes at most 1 positional', - str(self.warnings.log[0].message)) - def test_policy_deprecations(self): user = uuid.uuid4().hex user_domain = uuid.uuid4().hex @@ -599,38 +618,33 @@ self.assertIn(key, str(w[0].message)) def test_deprecated_args(self): - user = uuid.uuid4().hex - tenant = uuid.uuid4().hex - domain = uuid.uuid4().hex - user_domain = uuid.uuid4().hex - project_domain = uuid.uuid4().hex - - ctx = context.RequestContext(user=user, - tenant=tenant, - domain=domain, - user_domain=user_domain, - project_domain=project_domain) + user_id = uuid.uuid4().hex + project_id = uuid.uuid4().hex + domain_id = uuid.uuid4().hex + user_domain_id = uuid.uuid4().hex + project_domain_id = uuid.uuid4().hex + + ctx = context.RequestContext(user_id=user_id, + project_id=project_id, + domain_id=domain_id, + user_domain_id=user_domain_id, + project_domain_id=project_domain_id) self.assertEqual(0, len(self.warnings)) - self.assertEqual(user, ctx.user_id) - self.assertEqual(tenant, ctx.project_id) - self.assertEqual(domain, ctx.domain_id) - self.assertEqual(user_domain, ctx.user_domain_id) - self.assertEqual(project_domain, ctx.project_domain_id) + self.assertEqual(user_id, ctx.user_id) + self.assertEqual(project_id, ctx.project_id) + self.assertEqual(domain_id, ctx.domain_id) + self.assertEqual(user_domain_id, ctx.user_domain_id) + self.assertEqual(project_domain_id, ctx.project_domain_id) self.assertEqual(0, len(self.warnings)) - self.assertEqual(user, ctx.user) - if context._log_deprecation_warnings: - self.assertEqual(1, len(self.warnings)) - self.assertEqual(tenant, ctx.tenant) - if context._log_deprecation_warnings: - self.assertEqual(2, len(self.warnings)) - self.assertEqual(domain, ctx.domain) - if context._log_deprecation_warnings: - self.assertEqual(3, len(self.warnings)) - self.assertEqual(user_domain, ctx.user_domain) - if context._log_deprecation_warnings: - self.assertEqual(4, len(self.warnings)) - self.assertEqual(project_domain, ctx.project_domain) - if context._log_deprecation_warnings: - self.assertEqual(5, len(self.warnings)) + self.assertEqual(user_id, ctx.user) + self.assertEqual(1, len(self.warnings)) + self.assertEqual(project_id, ctx.tenant) + self.assertEqual(2, len(self.warnings)) + self.assertEqual(domain_id, ctx.domain) + self.assertEqual(3, len(self.warnings)) + self.assertEqual(user_domain_id, ctx.user_domain) + self.assertEqual(4, len(self.warnings)) + self.assertEqual(project_domain_id, ctx.project_domain) + self.assertEqual(5, len(self.warnings)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/releasenotes/notes/dont-leak-auth-token-fb7075316cf87b7c.yaml new/oslo.context-2.20.0/releasenotes/notes/dont-leak-auth-token-fb7075316cf87b7c.yaml --- old/oslo.context-2.17.0/releasenotes/notes/dont-leak-auth-token-fb7075316cf87b7c.yaml 1970-01-01 01:00:00.000000000 +0100 +++ new/oslo.context-2.20.0/releasenotes/notes/dont-leak-auth-token-fb7075316cf87b7c.yaml 2018-01-08 15:11:35.000000000 +0100 @@ -0,0 +1,7 @@ +--- +security: + - | + The ``get_logging_values`` function no longer outputs the auth_token, but + instead leaves it as ``***`` instead. As the name suggests, this function is + meant for logging, and letting the auth_token there might leak sensitive + data. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/releasenotes/source/conf.py new/oslo.context-2.20.0/releasenotes/source/conf.py --- old/oslo.context-2.17.0/releasenotes/source/conf.py 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/releasenotes/source/conf.py 2018-01-08 15:11:35.000000000 +0100 @@ -55,16 +55,12 @@ project = u'oslo.context Release Notes' copyright = u'2016, oslo.context Developers' -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -from oslo_context.version import version_info as oslo_context_version +# Release notes do not need a version in the title, they span +# multiple versions. # The full version, including alpha/beta/rc tags. -release = oslo_context_version.version_string_with_vcs() +release = '' # The short X.Y version. -version = oslo_context_version.canonical_version_string() +version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/releasenotes/source/index.rst new/oslo.context-2.20.0/releasenotes/source/index.rst --- old/oslo.context-2.17.0/releasenotes/source/index.rst 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/releasenotes/source/index.rst 2018-01-08 15:11:35.000000000 +0100 @@ -6,5 +6,6 @@ :maxdepth: 1 unreleased + pike ocata newton diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/releasenotes/source/pike.rst new/oslo.context-2.20.0/releasenotes/source/pike.rst --- old/oslo.context-2.17.0/releasenotes/source/pike.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/oslo.context-2.20.0/releasenotes/source/pike.rst 2018-01-08 15:11:35.000000000 +0100 @@ -0,0 +1,6 @@ +=================================== + Pike Series Release Notes +=================================== + +.. release-notes:: + :branch: stable/pike diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/requirements.txt new/oslo.context-2.20.0/requirements.txt --- old/oslo.context-2.17.0/requirements.txt 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/requirements.txt 2018-01-08 15:11:35.000000000 +0100 @@ -5,4 +5,3 @@ pbr!=2.1.0,>=2.0.0 # Apache-2.0 debtcollector>=1.2.0 # Apache-2.0 -positional>=1.1.1 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/test-requirements.txt new/oslo.context-2.20.0/test-requirements.txt --- old/oslo.context-2.17.0/test-requirements.txt 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/test-requirements.txt 2018-01-08 15:11:52.000000000 +0100 @@ -7,7 +7,5 @@ oslotest>=1.10.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 -# These are needed for docs generation -openstackdocstheme>=1.11.0 # Apache-2.0 -sphinx>=1.6.2 # BSD -reno!=2.3.1,>=1.8.0 # Apache-2.0 +# Bandit security code scanner +bandit>=1.1.0 # Apache-2.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/tools/tox_install.sh new/oslo.context-2.20.0/tools/tox_install.sh --- old/oslo.context-2.17.0/tools/tox_install.sh 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/tools/tox_install.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# Client constraint file contains this client version pin that is in conflict -# with installing the client from source. We should remove the version pin in -# the constraints file before applying it for from-source installation. - -CONSTRAINTS_FILE="$1" -shift 1 - -set -e - -# NOTE(tonyb): Place this in the tox enviroment's log dir so it will get -# published to logs.openstack.org for easy debugging. -localfile="$VIRTUAL_ENV/log/upper-constraints.txt" - -if [[ "$CONSTRAINTS_FILE" != http* ]]; then - CONSTRAINTS_FILE="file://$CONSTRAINTS_FILE" -fi -# NOTE(tonyb): need to add curl to bindep.txt if the project supports bindep -curl "$CONSTRAINTS_FILE" --insecure --progress-bar --output "$localfile" - -pip install -c"$localfile" openstack-requirements - -# This is the main purpose of the script: Allow local installation of -# the current repo. It is listed in constraints file and thus any -# install will be constrained and we need to unconstrain it. -edit-constraints "$localfile" -- "$CLIENT_NAME" - -pip install -c"$localfile" -U "$@" -exit $? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/oslo.context-2.17.0/tox.ini new/oslo.context-2.20.0/tox.ini --- old/oslo.context-2.17.0/tox.ini 2017-07-18 15:07:28.000000000 +0200 +++ new/oslo.context-2.20.0/tox.ini 2018-01-08 15:11:52.000000000 +0100 @@ -3,22 +3,29 @@ envlist = py35,py27,pypy,pep8 [testenv] -setenv = - VIRTUAL_ENV={envdir} - BRANCH_NAME=master - CLIENT_NAME=oslo.context -install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} -deps = -r{toxinidir}/test-requirements.txt +install_command = pip install {opts} {packages} +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' [testenv:pep8] -commands = flake8 +deps = + -r{toxinidir}/test-requirements.txt +commands = + flake8 + # Run security linter + bandit -r oslo_context -x tests -n5 [testenv:venv] commands = {posargs} [testenv:docs] -commands = python setup.py build_sphinx +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/doc/requirements.txt +commands = sphinx-build -b html doc/source doc/build/html [testenv:cover] commands = python setup.py test --coverage --coverage-package-name=oslo_context --testr-args='{posargs}' @@ -42,4 +49,7 @@ commands = pip-missing-reqs -d --ignore-module=oslo_context* --ignore-file=oslo_context/tests/* --ignore-file=tests/ oslo_context [testenv:releasenotes] +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html