Hello community,
here is the log from the commit of package python-oslo.context for
openSUSE:Factory checked in at 2017-02-21 13:46:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-oslo.context (Old)
and /work/SRC/openSUSE:Factory/.python-oslo.context.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-oslo.context"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-oslo.context/python-oslo.context.changes
2016-09-30 15:29:18.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.python-oslo.context.new/python-oslo.context.changes
2017-02-21 13:46:46.318570032 +0100
@@ -1,0 +2,27 @@
+Mon Feb 13 18:13:02 UTC 2017 - [email protected]
+
+- update to version 2.12.1:
+ - Move existing attributes to _id suffixed attributes
+ - Reformat the Context.__init__ arguments
+ - Remove references to Python 3.4
+ - Add Constraints support
+ - Show team and repo badges on README
+ - Update .gitreview for stable/ocata
+ - Postpone deprecation warnings to Pike
+ - Updated from global requirements
+ - Add the service token details to context
+
+-------------------------------------------------------------------
+Mon Feb 13 09:21:21 UTC 2017 - [email protected]
+
+- update to version 2.11.0:
+ - Update reno for stable/newton
+ - Revert "Fix X-User and X-Tenant deprecated headers in from_environ"
+ - Changed the home-page link
+ - Fix typos
+ - Enable release notes translation
+ - Fix X-User and X-Tenant deprecated headers in from_environ
+ - Updated from global requirements
+ - Provide a way to deprecate policy values
+
+-------------------------------------------------------------------
Old:
----
oslo.context-2.9.0.tar.gz
New:
----
oslo.context-2.12.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-oslo.context.spec ++++++
--- /var/tmp/diff_new_pack.9tYHlW/_old 2017-02-21 13:46:46.714514157 +0100
+++ /var/tmp/diff_new_pack.9tYHlW/_new 2017-02-21 13:46:46.718513593 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-oslo.context
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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
@@ -19,19 +19,21 @@
%global sname oslo.context
%bcond_without test
Name: python-oslo.context
-Version: 2.9.0
+Version: 2.12.1
Release: 0
Summary: OpenStack Oslo context library
License: Apache-2.0
-Group: Development/Languages
+Group: Development/Languages/Python
Url: https://launchpad.net/%{sname}
Source0:
https://pypi.io/packages/source/o/%{sname}/%{sname}-%{version}.tar.gz
BuildRequires: openstack-macros
-BuildRequires: python-pbr >= 1.6
-BuildRequires: python-positional >= 1.0.1
-Requires: python-positional >= 1.0.1
+BuildRequires: python-pbr >= 1.8
+BuildRequires: python-positional >= 1.1.1
+Requires: python-debtcollector >= 1.2.0
+Requires: python-positional >= 1.1.1
BuildArch: noarch
%if %{with test}
+BuildRequires: python-debtcollector >= 1.2.0
BuildRequires: python-oslotest >= 1.10.0
%endif
@@ -42,16 +44,17 @@
used by various modules such as logging.
%package doc
-Summary: Documentation for OpenStack common configuration library
+Summary: Documentation for OpenStack common context library
Group: Documentation
BuildRequires: python-Sphinx
-BuildRequires: python-oslosphinx >= 2.5.0
+BuildRequires: python-oslosphinx >= 4.7.0
%description doc
Documentation for the oslo-context library.
%prep
-%setup -q -n %{sname}-%{version}
+%autosetup -n %{sname}-%{version}
+%py_req_cleanup
%build
%{py2_build}
@@ -70,7 +73,7 @@
%files
%license LICENSE
-%doc README.rst AUTHORS
+%doc README.rst
%{python2_sitelib}/oslo_context
%{python2_sitelib}/*.egg-info
++++++ _service ++++++
--- /var/tmp/diff_new_pack.9tYHlW/_old 2017-02-21 13:46:46.754508514 +0100
+++ /var/tmp/diff_new_pack.9tYHlW/_new 2017-02-21 13:46:46.754508514 +0100
@@ -1,13 +1,12 @@
<services>
<service mode="disabled" name="renderspec">
- <param
name="input-template">https://raw.githubusercontent.com/openstack/rpm-packaging/master/openstack/oslo.context/oslo.context.spec.j2</param>
+ <param
name="input-template">https://raw.githubusercontent.com/openstack/rpm-packaging/stable/ocata/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/requirements/master/global-requirements.txt</param>
+ <param
name="requirements">https://raw.githubusercontent.com/openstack/rpm-packaging/stable/ocata/global-requirements.txt</param>
+ <param name="changelog-email">[email protected]</param>
+ <param name="changelog-provider">gh,openstack,oslo.context</param>
</service>
<service mode="disabled" name="download_files">
- <param name="changesgenerate">enable</param>
- </service>
- <service name="refresh_patches" mode="disabled">
- <param name="changesgenerate">enable</param>
</service>
+ <service name="format_spec_file" mode="disabled"/>
</services>
++++++ oslo.context-2.9.0.tar.gz -> oslo.context-2.12.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/AUTHORS
new/oslo.context-2.12.1/AUTHORS
--- old/oslo.context-2.9.0/AUTHORS 2016-08-18 19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/AUTHORS 2017-01-30 19:11:25.000000000 +0100
@@ -1,5 +1,7 @@
Alexander Gorodnev <[email protected]>
+Andreas Jaeger <[email protected]>
Andrew Bogott <[email protected]>
+Atsushi SAKAI <[email protected]>
ChangBo Guo(gcb) <[email protected]>
Cyril Roelandt <[email protected]>
Davanum Srinivas (dims) <[email protected]>
@@ -7,6 +9,8 @@
Davanum Srinivas <[email protected]>
Dina Belova <[email protected]>
Doug Hellmann <[email protected]>
+Eric Brown <[email protected]>
+Flavio Percoco <[email protected]>
Flavio Percoco <[email protected]>
James Carey <[email protected]>
Jamie Lennox <[email protected]>
@@ -19,12 +23,15 @@
Kirill Bespalov <[email protected]>
Michael Basnight <[email protected]>
Monty Taylor <[email protected]>
+OpenStack Release Bot <[email protected]>
Ronald Bradford <[email protected]>
Sean Dague <[email protected]>
Steve Martinelli <[email protected]>
Thomas Herve <[email protected]>
+Tony Breeds <[email protected]>
Victor Sergeyev <[email protected]>
Victor Stinner <[email protected]>
Wei Li <[email protected]>
Zhongyue Luo <[email protected]>
+melissaml <[email protected]>
yanheven <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/ChangeLog
new/oslo.context-2.12.1/ChangeLog
--- old/oslo.context-2.9.0/ChangeLog 2016-08-18 19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/ChangeLog 2017-01-30 19:11:25.000000000 +0100
@@ -1,6 +1,42 @@
CHANGES
=======
+2.12.1
+------
+
+* Postpone deprecation warnings to Pike
+* Update .gitreview for stable/ocata
+
+2.12.0
+------
+
+* Updated from global requirements
+* Remove references to Python 3.4
+* Add Constraints support
+* Show team and repo badges on README
+* Add the service token details to context
+* Reformat the Context.__init__ arguments
+* Move existing attributes to _id suffixed attributes
+
+2.11.0
+------
+
+* Updated from global requirements
+* Revert "Fix X-User and X-Tenant deprecated headers in from_environ"
+* Updated from global requirements
+* Updated from global requirements
+* Changed the home-page link
+
+2.10.0
+------
+
+* Enable release notes translation
+* Updated from global requirements
+* Provide a way to deprecate policy values
+* Update reno for stable/newton
+* Fix typos
+* Fix X-User and X-Tenant deprecated headers in from_environ
+
2.9.0
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/PKG-INFO
new/oslo.context-2.12.1/PKG-INFO
--- old/oslo.context-2.9.0/PKG-INFO 2016-08-18 19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/PKG-INFO 2017-01-30 19:11:25.000000000 +0100
@@ -1,12 +1,21 @@
Metadata-Version: 1.1
Name: oslo.context
-Version: 2.9.0
+Version: 2.12.1
Summary: Oslo Context library
-Home-page: http://launchpad.net/oslo
+Home-page: http://docs.openstack.org/developer/oslo.context
Author: OpenStack
Author-email: [email protected]
License: UNKNOWN
-Description: ====================
+Description: ========================
+ Team and repository tags
+ ========================
+
+ .. image:: http://governance.openstack.org/badges/oslo.context.svg
+ :target: http://governance.openstack.org/reference/tags/index.html
+
+ .. Change things from this point on
+
+ ====================
Oslo Context Library
====================
@@ -38,5 +47,4 @@
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/README.rst
new/oslo.context-2.12.1/README.rst
--- old/oslo.context-2.9.0/README.rst 2016-08-18 19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/README.rst 2017-01-30 19:09:52.000000000 +0100
@@ -1,3 +1,12 @@
+========================
+Team and repository tags
+========================
+
+.. image:: http://governance.openstack.org/badges/oslo.context.svg
+ :target: http://governance.openstack.org/reference/tags/index.html
+
+.. Change things from this point on
+
====================
Oslo Context Library
====================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/doc/source/examples/usage.py
new/oslo.context-2.12.1/doc/source/examples/usage.py
--- old/oslo.context-2.9.0/doc/source/examples/usage.py 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/doc/source/examples/usage.py 2017-01-30
19:09:52.000000000 +0100
@@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""A respresentative usage example of Oslo Context
+"""A representative usage example of Oslo Context
This example requires the following modules to be installed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/doc/source/examples.rst
new/oslo.context-2.12.1/doc/source/examples.rst
--- old/oslo.context-2.9.0/doc/source/examples.rst 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/doc/source/examples.rst 2017-01-30
19:09:52.000000000 +0100
@@ -6,9 +6,9 @@
These files can be found in the doc/source/examples directory of
the git source of this project. They can also be found at the
-`online git respository`_ of this project.
+`online git repository`_ of this project.
-.. _online git respository:
http://git.openstack.org/cgit/openstack/oslo.context/tree/doc/source/examples
+.. _online git repository:
http://git.openstack.org/cgit/openstack/oslo.context/tree/doc/source/examples
.. _example_usage_simple.py:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/oslo.context.egg-info/PKG-INFO
new/oslo.context-2.12.1/oslo.context.egg-info/PKG-INFO
--- old/oslo.context-2.9.0/oslo.context.egg-info/PKG-INFO 2016-08-18
19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/oslo.context.egg-info/PKG-INFO 2017-01-30
19:11:25.000000000 +0100
@@ -1,12 +1,21 @@
Metadata-Version: 1.1
Name: oslo.context
-Version: 2.9.0
+Version: 2.12.1
Summary: Oslo Context library
-Home-page: http://launchpad.net/oslo
+Home-page: http://docs.openstack.org/developer/oslo.context
Author: OpenStack
Author-email: [email protected]
License: UNKNOWN
-Description: ====================
+Description: ========================
+ Team and repository tags
+ ========================
+
+ .. image:: http://governance.openstack.org/badges/oslo.context.svg
+ :target: http://governance.openstack.org/reference/tags/index.html
+
+ .. Change things from this point on
+
+ ====================
Oslo Context Library
====================
@@ -38,5 +47,4 @@
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/oslo.context.egg-info/SOURCES.txt
new/oslo.context-2.12.1/oslo.context.egg-info/SOURCES.txt
--- old/oslo.context-2.9.0/oslo.context.egg-info/SOURCES.txt 2016-08-18
19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/oslo.context.egg-info/SOURCES.txt 2017-01-30
19:11:25.000000000 +0100
@@ -43,6 +43,8 @@
releasenotes/notes/add_reno-3b4ae0789e9c45b4.yaml
releasenotes/source/conf.py
releasenotes/source/index.rst
+releasenotes/source/newton.rst
releasenotes/source/unreleased.rst
releasenotes/source/_static/.placeholder
-releasenotes/source/_templates/.placeholder
\ No newline at end of file
+releasenotes/source/_templates/.placeholder
+tools/tox_install.sh
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/oslo.context.egg-info/pbr.json
new/oslo.context-2.12.1/oslo.context.egg-info/pbr.json
--- old/oslo.context-2.9.0/oslo.context.egg-info/pbr.json 2016-08-18
19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/oslo.context.egg-info/pbr.json 2017-01-30
19:11:25.000000000 +0100
@@ -1 +1 @@
-{"git_version": "0ad0950", "is_release": true}
\ No newline at end of file
+{"is_release": true, "git_version": "9071eb9"}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo.context-2.9.0/oslo.context.egg-info/requires.txt
new/oslo.context-2.12.1/oslo.context.egg-info/requires.txt
--- old/oslo.context-2.9.0/oslo.context.egg-info/requires.txt 2016-08-18
19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/oslo.context.egg-info/requires.txt 2017-01-30
19:11:25.000000000 +0100
@@ -1,2 +1,3 @@
-pbr>=1.6
-positional>=1.0.1
+pbr>=1.8
+debtcollector>=1.2.0
+positional>=1.1.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/oslo_context/context.py
new/oslo.context-2.12.1/oslo_context/context.py
--- old/oslo.context-2.9.0/oslo_context/context.py 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/oslo_context/context.py 2017-01-30
19:09:53.000000000 +0100
@@ -26,33 +26,47 @@
or logging context.
"""
+import collections
import itertools
import threading
import uuid
+import warnings
+import debtcollector
from positional import positional
-
_request_store = threading.local()
# These arguments will be passed to a new context from the first available
# header to support backwards compatibility.
-_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_name': ['HTTP_X_USER_NAME'],
- 'project_name': ['HTTP_X_PROJECT_NAME',
- 'HTTP_X_TENANT_NAME'],
- 'user_domain_name': ['HTTP_X_USER_DOMAIN_NAME'],
- 'project_domain_name': ['HTTP_X_PROJECT_DOMAIN_NAME'],
- 'request_id': ['openstack.request_id'],
- }
+_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_name': ['HTTP_X_USER_NAME'],
+ 'project_name': ['HTTP_X_PROJECT_NAME',
+ 'HTTP_X_TENANT_NAME'],
+ 'user_domain_name': ['HTTP_X_USER_DOMAIN_NAME'],
+ 'project_domain_name': ['HTTP_X_PROJECT_DOMAIN_NAME'],
+ 'request_id': ['openstack.request_id'],
+
+
+ 'service_token': ['HTTP_X_SERVICE_TOKEN'],
+ 'service_user_id': ['HTTP_X_SERVICE_USER_ID'],
+ 'service_user_name': ['HTTP_X_SERVICE_USER_NAME'],
+ 'service_user_domain_id': ['HTTP_X_SERVICE_USER_DOMAIN_ID'],
+ 'service_user_domain_name': ['HTTP_X_SERVICE_USER_DOMAIN_NAME'],
+ 'service_project_id': ['HTTP_X_SERVICE_PROJECT_ID'],
+ 'service_project_name': ['HTTP_X_SERVICE_PROJECT_NAME'],
+ 'service_project_domain_id': ['HTTP_X_SERVICE_PROJECT_DOMAIN_ID'],
+ 'service_project_domain_name': ['HTTP_X_SERVICE_PROJECT_DOMAIN_NAME'],
+}
def generate_request_id():
@@ -60,6 +74,100 @@
return 'req-%s' % uuid.uuid4()
+class _DeprecatedPolicyValues(collections.MutableMapping):
+ """A Dictionary that manages current and deprecated policy values.
+
+ Anything added to this dictionary after initial creation is considered a
+ deprecated key that we are trying to move services away from. Accessing
+ these values as oslo.policy will do will trigger a DeprecationWarning.
+ """
+
+ def __init__(self, data):
+ self._data = data
+ self._deprecated = {}
+
+ def __getitem__(self, k):
+ try:
+ return self._data[k]
+ except KeyError:
+ pass
+
+ try:
+ val = self._deprecated[k]
+ except KeyError:
+ pass
+ else:
+ warnings.warn('Policy enforcement is depending on the value of '
+ '%s. This key is deprecated. Please update your '
+ 'policy file to use the standard policy values.' % k,
+ DeprecationWarning)
+ return val
+
+ raise KeyError(k)
+
+ def __setitem__(self, k, v):
+ self._deprecated[k] = v
+
+ def __delitem__(self, k):
+ del self._deprecated[k]
+
+ def __iter__(self):
+ return iter(self._dict)
+
+ def __len__(self):
+ return len(self._dict)
+
+ def __str__(self):
+ return self._dict.__str__()
+
+ def __repr__(self):
+ return self._dict.__repr__()
+
+ @property
+ def _dict(self):
+ d = self._deprecated.copy()
+ d.update(self._data)
+ 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)
+
+
+def _moved_property(new_name, old_name=None, target=None):
+
+ if not target:
+ target = new_name
+
+ def getter(self):
+ _moved_msg(new_name, old_name)
+ return getattr(self, target)
+
+ def setter(self, value):
+ _moved_msg(new_name, old_name)
+ setattr(self, target, value)
+
+ def deleter(self):
+ _moved_msg(new_name, old_name)
+ delattr(self, target)
+
+ return property(getter, setter, deleter)
+
+
class RequestContext(object):
"""Helper class to represent useful information about a request context.
@@ -71,13 +179,36 @@
user_idt_format = u'{user} {tenant} {domain} {user_domain} {p_domain}'
@positional(enforcement=positional.WARN)
- def __init__(self, auth_token=None, user=None, tenant=None, domain=None,
- user_domain=None, project_domain=None, is_admin=False,
- read_only=False, show_deleted=False, request_id=None,
- resource_uuid=None, overwrite=True, roles=None,
- user_name=None, project_name=None, domain_name=None,
- user_domain_name=None, project_domain_name=None,
- is_admin_project=True):
+ def __init__(self,
+ auth_token=None,
+ user=None,
+ tenant=None,
+ domain=None,
+ user_domain=None,
+ project_domain=None,
+ is_admin=False,
+ read_only=False,
+ show_deleted=False,
+ request_id=None,
+ resource_uuid=None,
+ overwrite=True,
+ roles=None,
+ user_name=None,
+ project_name=None,
+ domain_name=None,
+ user_domain_name=None,
+ project_domain_name=None,
+ is_admin_project=True,
+ service_token=None,
+ service_user_id=None,
+ service_user_name=None,
+ service_user_domain_id=None,
+ service_user_domain_name=None,
+ service_project_id=None,
+ service_project_name=None,
+ service_project_domain_id=None,
+ service_project_domain_name=None,
+ service_roles=None):
"""Initialize the RequestContext
:param overwrite: Set to False to ensure that the greenthread local
@@ -87,18 +218,18 @@
True for backwards compatibility.
: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.auth_token = auth_token
- self.user = user
self.user_name = user_name
- # NOTE (rbradfor): tenant will become project
- # See spec discussion on https://review.openstack.org/#/c/290907/
- self.tenant = tenant
self.project_name = project_name
- self.domain = domain
self.domain_name = domain_name
- self.user_domain = user_domain
self.user_domain_name = user_domain_name
- self.project_domain = project_domain
self.project_domain_name = project_domain_name
self.is_admin = is_admin
self.is_admin_project = is_admin_project
@@ -106,12 +237,43 @@
self.show_deleted = show_deleted
self.resource_uuid = resource_uuid
self.roles = roles or []
+
+ self.service_token = service_token
+ self.service_user_id = service_user_id
+ self.service_user_name = service_user_name
+ self.service_user_domain_id = service_user_domain_id
+ self.service_user_domain_name = service_user_domain_name
+ self.service_project_id = service_project_id
+ self.service_project_name = service_project_name
+ self.service_project_domain_id = service_project_domain_id
+ self.service_project_domain_name = service_project_domain_name
+ self.service_roles = service_roles or []
+
if not request_id:
request_id = generate_request_id()
self.request_id = request_id
if overwrite or not get_current():
self.update_store()
+ # NOTE(jamielennox): To prevent circular lookups on subclasses that might
+ # point user to user_id we make user/user_id tenant/project_id etc point
+ # to the same private variable rather than each other.
+ tenant = _moved_property('project_id', 'tenant', target='_project_id')
+ user = _moved_property('user_id', 'user', target='_user_id')
+ domain = _moved_property('domain_id', 'domain', target='_domain_id')
+ user_domain = _moved_property('user_domain_id',
+ 'user_domain',
+ target='_user_domain_id')
+ project_domain = _moved_property('project_domain_id',
+ 'project_domain',
+ target='_project_domain_id')
+
+ user_id = _moved_property('_user_id')
+ project_id = _moved_property('_project_id')
+ domain_id = _moved_property('_domain_id')
+ user_domain_id = _moved_property('_user_domain_id')
+ project_domain_id = _moved_property('_project_domain_id')
+
def update_store(self):
"""Store the context in the current thread."""
_request_store.context = self
@@ -128,27 +290,37 @@
with either deprecated values or additional attributes used by that
service specific policy.
"""
- return {'user_id': self.user,
- 'user_domain_id': self.user_domain,
- 'project_id': self.tenant,
- 'project_domain_id': self.project_domain,
- 'roles': self.roles,
- 'is_admin_project': self.is_admin_project}
+ # NOTE(jamielennox): We need a way to allow projects to provide old
+ # deprecated policy values that trigger a warning when used in favour
+ # of our standard ones. This object acts like a dict but only values
+ # from oslo.policy don't show a warning.
+ return _DeprecatedPolicyValues({
+ 'user_id': self.user_id,
+ 'user_domain_id': self.user_domain_id,
+ 'project_id': self.project_id,
+ 'project_domain_id': self.project_domain_id,
+ 'roles': self.roles,
+ 'is_admin_project': self.is_admin_project,
+ 'service_user_id': self.service_user_id,
+ 'service_user_domain_id': self.service_user_domain_id,
+ 'service_project_id': self.service_project_id,
+ 'service_project_domain_id': self.service_project_domain_id,
+ 'service_roles': self.service_roles})
def to_dict(self):
"""Return a dictionary of context attributes."""
- user_idt = (
- self.user_idt_format.format(user=self.user or '-',
- tenant=self.tenant or '-',
- domain=self.domain or '-',
- user_domain=self.user_domain or '-',
- p_domain=self.project_domain or '-'))
-
- return {'user': self.user,
- 'tenant': self.tenant,
- 'domain': self.domain,
- 'user_domain': self.user_domain,
- 'project_domain': self.project_domain,
+ user_idt = self.user_idt_format.format(
+ user=self.user_id or '-',
+ tenant=self.project_id or '-',
+ domain=self.domain_id or '-',
+ user_domain=self.user_domain_id or '-',
+ p_domain=self.project_domain_id or '-')
+
+ return {'user': self.user_id,
+ 'tenant': self.project_id,
+ 'domain': self.domain_id,
+ 'user_domain': self.user_domain_id,
+ 'project_domain': self.project_domain_id,
'is_admin': self.is_admin,
'read_only': self.read_only,
'show_deleted': self.show_deleted,
@@ -223,6 +395,11 @@
roles = [r.strip() for r in roles.split(',')] if roles else []
kwargs['roles'] = roles
+ if 'service_roles' not in kwargs:
+ roles = environ.get('HTTP_X_SERVICE_ROLES')
+ roles = [r.strip() for r in roles.split(',')] if roles else []
+ kwargs['service_roles'] = roles
+
if 'is_admin_project' not in kwargs:
# NOTE(jamielennox): we default is_admin_project to true because if
# nothing is provided we have to assume it is the admin project to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/oslo.context-2.9.0/oslo_context/tests/test_context.py
new/oslo.context-2.12.1/oslo_context/tests/test_context.py
--- old/oslo.context-2.9.0/oslo_context/tests/test_context.py 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/oslo_context/tests/test_context.py 2017-01-30
19:09:53.000000000 +0100
@@ -43,6 +43,12 @@
self.addCleanup(self._w.__exit__)
warnings.simplefilter(self.action, self.category)
+ def __len__(self):
+ return len(self.log)
+
+ def __getitem__(self, item):
+ return self.log[item]
+
class Object(object):
pass
@@ -93,7 +99,7 @@
self.assertIsInstance(ctx, context.RequestContext)
self.assertTrue(ctx.is_admin)
self.assertFalse(ctx.show_deleted)
- self.assertIsNone(ctx.tenant)
+ self.assertIsNone(ctx.project_id)
def test_admin_context_show_deleted_flag_set(self):
ctx = context.get_admin_context(show_deleted=True)
@@ -122,11 +128,11 @@
}
ctx = context.RequestContext.from_dict(dct)
self.assertEqual(dct['auth_token'], ctx.auth_token)
- self.assertEqual(dct['user'], ctx.user)
- self.assertEqual(dct['tenant'], ctx.tenant)
- self.assertEqual(dct['domain'], ctx.domain)
- self.assertEqual(dct['user_domain'], ctx.user_domain)
- self.assertEqual(dct['project_domain'], ctx.project_domain)
+ self.assertEqual(dct['user'], ctx.user_id)
+ self.assertEqual(dct['tenant'], ctx.project_id)
+ self.assertEqual(dct['domain'], ctx.domain_id)
+ self.assertEqual(dct['user_domain'], ctx.user_domain_id)
+ self.assertEqual(dct['project_domain'], ctx.project_domain_id)
self.assertTrue(ctx.is_admin)
self.assertTrue(ctx.read_only)
self.assertTrue(ctx.show_deleted)
@@ -149,8 +155,8 @@
}
ctx = context.RequestContext.from_dict(dct)
self.assertEqual("token1", ctx.auth_token)
- self.assertEqual("user1", ctx.user)
- self.assertIsNone(ctx.tenant)
+ self.assertEqual("user1", ctx.user_id)
+ self.assertIsNone(ctx.project_id)
self.assertFalse(ctx.is_admin)
self.assertTrue(ctx.read_only)
self.assertRaises(KeyError, lambda: ctx.__dict__['color'])
@@ -194,32 +200,67 @@
project_domain_id = generate_id(project_domain_name)
roles = [uuid.uuid4().hex, uuid.uuid4().hex, uuid.uuid4().hex]
request_id = uuid.uuid4().hex
-
- environ = {'HTTP_X_AUTH_TOKEN': auth_token,
- 'HTTP_X_USER_ID': user_id,
- 'HTTP_X_PROJECT_ID': project_id,
- 'HTTP_X_USER_DOMAIN_ID': user_domain_id,
- 'HTTP_X_PROJECT_DOMAIN_ID': project_domain_id,
- 'HTTP_X_ROLES': ','.join(roles),
- 'HTTP_X_USER_NAME': user_name,
- 'HTTP_X_PROJECT_NAME': project_name,
- 'HTTP_X_USER_DOMAIN_NAME': user_domain_name,
- 'HTTP_X_PROJECT_DOMAIN_NAME': project_domain_name,
- 'openstack.request_id': request_id}
+ service_token = uuid.uuid4().hex
+ service_user_id = uuid.uuid4().hex
+ service_user_name = uuid.uuid4().hex
+ service_user_domain_id = uuid.uuid4().hex
+ service_user_domain_name = uuid.uuid4().hex
+ service_project_id = uuid.uuid4().hex
+ service_project_name = uuid.uuid4().hex
+ service_project_domain_id = uuid.uuid4().hex
+ service_project_domain_name = uuid.uuid4().hex
+ service_roles = [uuid.uuid4().hex, uuid.uuid4().hex, uuid.uuid4().hex]
+
+ environ = {
+ 'HTTP_X_AUTH_TOKEN': auth_token,
+ 'HTTP_X_USER_ID': user_id,
+ 'HTTP_X_PROJECT_ID': project_id,
+ 'HTTP_X_USER_DOMAIN_ID': user_domain_id,
+ 'HTTP_X_PROJECT_DOMAIN_ID': project_domain_id,
+ 'HTTP_X_ROLES': ','.join(roles),
+ 'HTTP_X_USER_NAME': user_name,
+ 'HTTP_X_PROJECT_NAME': project_name,
+ 'HTTP_X_USER_DOMAIN_NAME': user_domain_name,
+ 'HTTP_X_PROJECT_DOMAIN_NAME': project_domain_name,
+ 'HTTP_X_SERVICE_TOKEN': service_token,
+ 'HTTP_X_SERVICE_USER_ID': service_user_id,
+ 'HTTP_X_SERVICE_USER_NAME': service_user_name,
+ 'HTTP_X_SERVICE_USER_DOMAIN_ID': service_user_domain_id,
+ 'HTTP_X_SERVICE_USER_DOMAIN_NAME': service_user_domain_name,
+ 'HTTP_X_SERVICE_PROJECT_ID': service_project_id,
+ 'HTTP_X_SERVICE_PROJECT_NAME': service_project_name,
+ 'HTTP_X_SERVICE_PROJECT_DOMAIN_ID': service_project_domain_id,
+ 'HTTP_X_SERVICE_PROJECT_DOMAIN_NAME': service_project_domain_name,
+ 'HTTP_X_SERVICE_ROLES': ','.join(service_roles),
+ 'openstack.request_id': request_id,
+ }
ctx = context.RequestContext.from_environ(environ)
self.assertEqual(auth_token, ctx.auth_token)
- self.assertEqual(user_id, ctx.user)
+ self.assertEqual(user_id, ctx.user_id)
self.assertEqual(user_name, ctx.user_name)
- self.assertEqual(project_id, ctx.tenant)
+ self.assertEqual(project_id, ctx.project_id)
self.assertEqual(project_name, ctx.project_name)
- self.assertEqual(user_domain_id, ctx.user_domain)
+ self.assertEqual(user_domain_id, ctx.user_domain_id)
self.assertEqual(user_domain_name, ctx.user_domain_name)
- self.assertEqual(project_domain_id, ctx.project_domain)
+ self.assertEqual(project_domain_id, ctx.project_domain_id)
self.assertEqual(project_domain_name, ctx.project_domain_name)
self.assertEqual(roles, ctx.roles)
self.assertEqual(request_id, ctx.request_id)
+ self.assertEqual(service_token, ctx.service_token)
+ self.assertEqual(service_user_id, ctx.service_user_id)
+ self.assertEqual(service_user_name, ctx.service_user_name)
+ self.assertEqual(service_user_domain_id, ctx.service_user_domain_id)
+ self.assertEqual(service_user_domain_name,
+ ctx.service_user_domain_name)
+ self.assertEqual(service_project_id, ctx.service_project_id)
+ self.assertEqual(service_project_name, ctx.service_project_name)
+ self.assertEqual(service_project_domain_id,
+ ctx.service_project_domain_id)
+ self.assertEqual(service_project_domain_name,
+ ctx.service_project_domain_name)
+ self.assertEqual(service_roles, ctx.service_roles)
def test_from_environ_no_roles(self):
ctx = context.RequestContext.from_environ(environ={})
@@ -237,7 +278,7 @@
environ = {'HTTP_X_TENANT_ID': value}
ctx = context.RequestContext.from_environ(environ=environ)
- self.assertEqual(value, ctx.tenant)
+ self.assertEqual(value, ctx.project_id)
environ = {'HTTP_X_STORAGE_TOKEN': value}
ctx = context.RequestContext.from_environ(environ=environ)
@@ -274,11 +315,11 @@
'HTTP_X_PROJECT_ID': new}
ctx = context.RequestContext.from_environ(environ=environ)
- self.assertEqual(new, ctx.tenant)
+ self.assertEqual(new, ctx.project_id)
ctx = context.RequestContext.from_environ(environ=environ,
tenant=override)
- self.assertEqual(override, ctx.tenant)
+ self.assertEqual(override, ctx.project_id)
environ = {'HTTP_X_TENANT_NAME': old,
'HTTP_X_PROJECT_NAME': new}
@@ -287,9 +328,11 @@
self.assertEqual(new, ctx.project_name)
def test_from_environ_strip_roles(self):
- environ = {'HTTP_X_ROLES': ' abc\t,\ndef\n,ghi\n\n'}
+ environ = {'HTTP_X_ROLES': ' abc\t,\ndef\n,ghi\n\n',
+ 'HTTP_X_SERVICE_ROLES': ' jkl\t,\nmno\n,pqr\n\n'}
ctx = context.RequestContext.from_environ(environ=environ)
self.assertEqual(['abc', 'def', 'ghi'], ctx.roles)
+ self.assertEqual(['jkl', 'mno', 'pqr'], ctx.service_roles)
def test_environ_admin_project(self):
environ = {}
@@ -358,15 +401,15 @@
request_id=request_id,
resource_uuid=resource_uuid)
self.assertEqual(auth_token, ctx.auth_token)
- self.assertEqual(user_id, ctx.user)
+ self.assertEqual(user_id, ctx.user_id)
self.assertEqual(user_name, ctx.user_name)
- self.assertEqual(project_id, ctx.tenant)
+ self.assertEqual(project_id, ctx.project_id)
self.assertEqual(project_name, ctx.project_name)
- self.assertEqual(domain_id, ctx.domain)
+ self.assertEqual(domain_id, ctx.domain_id)
self.assertEqual(domain_name, ctx.domain_name)
- self.assertEqual(user_domain_id, ctx.user_domain)
+ self.assertEqual(user_domain_id, ctx.user_domain_id)
self.assertEqual(user_domain_name, ctx.user_domain_name)
- self.assertEqual(project_domain_id, ctx.project_domain)
+ self.assertEqual(project_domain_id, ctx.project_domain_id)
self.assertEqual(project_domain_name, ctx.project_domain_name)
self.assertEqual(is_admin, ctx.is_admin)
self.assertEqual(read_only, ctx.read_only)
@@ -455,36 +498,54 @@
tenant = uuid.uuid4().hex
project_domain = uuid.uuid4().hex
roles = [uuid.uuid4().hex, uuid.uuid4().hex, uuid.uuid4().hex]
+ service_user_id = uuid.uuid4().hex
+ service_project_id = uuid.uuid4().hex
+ service_roles = [uuid.uuid4().hex, uuid.uuid4().hex, uuid.uuid4().hex]
# default is_admin_project is True
ctx = context.RequestContext(user=user,
user_domain=user_domain,
tenant=tenant,
project_domain=project_domain,
- roles=roles)
+ roles=roles,
+ service_user_id=service_user_id,
+ service_project_id=service_project_id,
+ service_roles=service_roles)
self.assertEqual({'user_id': user,
'user_domain_id': user_domain,
'project_id': tenant,
'project_domain_id': project_domain,
'roles': roles,
- 'is_admin_project': True},
+ 'is_admin_project': True,
+ 'service_user_id': service_user_id,
+ 'service_user_domain_id': None,
+ 'service_project_id': service_project_id,
+ 'service_project_domain_id': None,
+ 'service_roles': service_roles},
ctx.to_policy_values())
- # is_admin_project False gets passed through
ctx = context.RequestContext(user=user,
user_domain=user_domain,
tenant=tenant,
project_domain=project_domain,
roles=roles,
- is_admin_project=False)
+ is_admin_project=False,
+ service_user_id=service_user_id,
+ service_project_id=service_project_id,
+ service_roles=service_roles)
self.assertEqual({'user_id': user,
'user_domain_id': user_domain,
'project_id': tenant,
'project_domain_id': project_domain,
'roles': roles,
- 'is_admin_project': False},
+ 'is_admin_project': False,
+ 'service_user_id': service_user_id,
+ 'service_user_domain_id': None,
+ 'service_project_id': service_project_id,
+ 'service_project_domain_id': None,
+ 'service_roles': service_roles},
ctx.to_policy_values())
def test_positional_args(self):
@@ -493,3 +554,69 @@
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
+ tenant = uuid.uuid4().hex
+ project_domain = uuid.uuid4().hex
+ roles = [uuid.uuid4().hex, uuid.uuid4().hex, uuid.uuid4().hex]
+
+ ctx = context.RequestContext(user=user,
+ user_domain=user_domain,
+ tenant=tenant,
+ project_domain=project_domain,
+ roles=roles)
+
+ policy = ctx.to_policy_values()
+ key = uuid.uuid4().hex
+ val = uuid.uuid4().hex
+
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+
+ # no warning triggered by adding key to dict
+ policy[key] = val
+ self.assertEqual(0, len(w))
+
+ # warning triggered by fetching key from dict
+ self.assertIs(val, policy[key])
+ self.assertEqual(1, len(w))
+ 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)
+
+ 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(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))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/releasenotes/source/conf.py
new/oslo.context-2.12.1/releasenotes/source/conf.py
--- old/oslo.context-2.9.0/releasenotes/source/conf.py 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/releasenotes/source/conf.py 2017-01-30
19:09:52.000000000 +0100
@@ -271,3 +271,6 @@
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
+
+# -- Options for Internationalization output ------------------------------
+locale_dirs = ['locale/']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/releasenotes/source/index.rst
new/oslo.context-2.12.1/releasenotes/source/index.rst
--- old/oslo.context-2.9.0/releasenotes/source/index.rst 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/releasenotes/source/index.rst 2017-01-30
19:09:52.000000000 +0100
@@ -6,3 +6,4 @@
:maxdepth: 1
unreleased
+ newton
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/releasenotes/source/newton.rst
new/oslo.context-2.12.1/releasenotes/source/newton.rst
--- old/oslo.context-2.9.0/releasenotes/source/newton.rst 1970-01-01
01:00:00.000000000 +0100
+++ new/oslo.context-2.12.1/releasenotes/source/newton.rst 2017-01-30
19:09:52.000000000 +0100
@@ -0,0 +1,6 @@
+=============================
+ Newton Series Release Notes
+=============================
+
+.. release-notes::
+ :branch: origin/stable/newton
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/requirements.txt
new/oslo.context-2.12.1/requirements.txt
--- old/oslo.context-2.9.0/requirements.txt 2016-08-18 19:57:09.000000000
+0200
+++ new/oslo.context-2.12.1/requirements.txt 2017-01-30 19:09:52.000000000
+0100
@@ -2,6 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
-pbr>=1.6 # Apache-2.0
+pbr>=1.8 # Apache-2.0
-positional>=1.0.1 # 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.9.0/setup.cfg
new/oslo.context-2.12.1/setup.cfg
--- old/oslo.context-2.9.0/setup.cfg 2016-08-18 19:58:39.000000000 +0200
+++ new/oslo.context-2.12.1/setup.cfg 2017-01-30 19:11:25.000000000 +0100
@@ -5,7 +5,7 @@
README.rst
author = OpenStack
author-email = [email protected]
-home-page = http://launchpad.net/oslo
+home-page = http://docs.openstack.org/developer/oslo.context
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@@ -16,7 +16,6 @@
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
- Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
[files]
@@ -54,5 +53,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/test-requirements.txt
new/oslo.context-2.12.1/test-requirements.txt
--- old/oslo.context-2.9.0/test-requirements.txt 2016-08-18
19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/test-requirements.txt 2017-01-30
19:09:52.000000000 +0100
@@ -5,9 +5,9 @@
fixtures>=3.0.0 # Apache-2.0/BSD
hacking<0.11,>=0.10.0
oslotest>=1.10.0 # Apache-2.0
-coverage>=3.6 # Apache-2.0
+coverage>=4.0 # Apache-2.0
# These are needed for docs generation
-oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
-sphinx!=1.3b1,<1.3,>=1.2.1 # BSD
-reno>=1.8.0 # Apache2
+oslosphinx>=4.7.0 # Apache-2.0
+sphinx!=1.3b1,<1.4,>=1.2.1 # BSD
+reno>=1.8.0 # Apache-2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/oslo.context-2.9.0/tools/tox_install.sh
new/oslo.context-2.12.1/tools/tox_install.sh
--- old/oslo.context-2.9.0/tools/tox_install.sh 1970-01-01 01:00:00.000000000
+0100
+++ new/oslo.context-2.12.1/tools/tox_install.sh 2017-01-30
19:09:52.000000000 +0100
@@ -0,0 +1,30 @@
+#!/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.9.0/tox.ini
new/oslo.context-2.12.1/tox.ini
--- old/oslo.context-2.9.0/tox.ini 2016-08-18 19:57:09.000000000 +0200
+++ new/oslo.context-2.12.1/tox.ini 2017-01-30 19:09:52.000000000 +0100
@@ -1,8 +1,13 @@
[tox]
-minversion = 1.6
-envlist = py35,py34,py27,pypy,pep8
+minversion = 2.0
+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
commands = python setup.py testr --slowest --testr-args='{posargs}'