requires positional >= 1.1.0

Bug #1620963 reported by James Page on 2016-09-07
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

oslo.context currently specifies:

  positional>=1.0.1 # Apache-2.0

however using this version causes a number of unit test failures in barbican; updating to 1.1.1 resolves this issue, so global-requirements should probably be bumped inline with this.

James Page (james-page) wrote :

Build log for reference:

Its also easy to reproduce by downgrading positional to 1.0.1 in the barbican py27 venv and then re-running the tests.

James Page (james-page) wrote :
Download full text (3.1 KiB)

Captured pythonlogging:
       ERROR [barbican.api.controllers] ContainerConsumer deletion attempt not allowed - please review your user/project privileges


Captured traceback:
    Traceback (most recent call last):
      File "barbican/tests/api/", line 1069, in test_should_pass_get_consumers
      File "barbican/tests/api/", line 184, in _assert_pass_rbac
      File "/usr/lib/python2.7/dist-packages/testtools/", line 422, in assertRaises
        self.assertThat(our_callable, matcher)
      File "/usr/lib/python2.7/dist-packages/testtools/", line 433, in assertThat
        mismatch_error = self._matchHelper(matchee, matcher, message, verbose)
      File "/usr/lib/python2.7/dist-packages/testtools/", line 483, in _matchHelper
        mismatch = matcher.match(matchee)
      File "/usr/lib/python2.7/dist-packages/testtools/matchers/", line 108, in match
        mismatch = self.exception_matcher.match(exc_info)
      File "/usr/lib/python2.7/dist-packages/testtools/matchers/", line 62, in match
        mismatch = matcher.match(matchee)
      File "/usr/lib/python2.7/dist-packages/testtools/", line 414, in match
      File "/usr/lib/python2.7/dist-packages/testtools/matchers/", line 101, in match
        result = matchee()
      File "/usr/lib/python2.7/dist-packages/testtools/", line 969, in __call__
        return self._callable_object(*self._args, **self._kwargs)
      File "barbican/tests/api/", line 1083, in _invoke_on_get
        self.resource.on_get(self.req, self.resp)
      File "barbican/tests/api/", line 54, in on_get
        return self.controller.on_get(*args, **kwargs)
      File "barbican/api/controllers/", line 113, in handler
        pecan.abort(status, message)
      File "/usr/lib/python2.7/dist-packages/pecan/", line 138, in abort
        exec('raise webob_exception, None, traceback')
      File "barbican/api/controllers/", line 103, in handler
        return fn(inst, *args, **kwargs)
      File "barbican/api/controllers/", line 84, in enforcer
        _do_enforce_rbac(inst, pecan.request, action_name, ctx, **kwargs)
      File "barbican/api/controllers/", line 67, in _do_enforce_rbac
        credentials, do_raise=True)
      File "/usr/lib/python2.7/dist-packages/oslo_policy/", line 653, in enforce
        raise PolicyNotAuthorized(rule, target, creds)
    webob.exc.HTTPForbidden: ContainerConsumers(s) retrieval attempt not allowed - please review your user/project privileges

Captured pythonlogging:
       ERROR [barbican.api.controllers] ContainerConsumers(s) retrieval attempt not allowed - please review your...


Jamie Lennox (jamielennox) wrote :

This is because barbican does inspect on oslo_context.RequestContext.__init__ and positional < 1.1 used @functools.wraps which makes a mess of this.

The inspect part of barbican is no longer needed so we can just remove this and positional 1.0.1 should continue to work.

Submitter: Jenkins
Branch: master

commit 6c814fefbc062b2643b52bb5281743b482f6ea9c
Author: Jamie Lennox <email address hidden>
Date: Tue Sep 13 10:44:38 2016 +1000

    Don't inspect oslo.context

    When creating an oslo.context we inspected the __init__ string to figure
    out if roles were part of the context. This was added in oslo.context
    2.2 and there needed to be compatibility between old and new.

    Now that requirements specify oslo.context >= 2.9 we don't need this
    clause any more, and it is causing release issues with older versions of

    Remove the inspection and rely on newer versions of oslo.context.

    Closes-Bug: #1620963
    Change-Id: I2fcb4f1718ae5e5b50e26d9dee0e0df2f1e6cf72

Changed in barbican:
status: New → Fix Released

This issue was fixed in the openstack/barbican release candidate.

This issue was fixed in the openstack/barbican 3.0.0 release.

Doug Hellmann (doug-hellmann) wrote :

oslo.context no longer uses positional

Changed in oslo.context:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers