stable/newton AttributeError: __exit__ rackspace.tests.test_cloud_loadbalancer.LoadBalancerTest.test_check()

Bug #1718288 reported by Corey Bryant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
New
Undecided
Unassigned

Bug Description

On stable/newton, the rackspace.tests.test_cloud_loadbalancer.LoadBalancerTest.test_check() test is failing with 'AttributeError: __exit__'.

Here's the full traceback: http://paste.ubuntu.com/25574958/

If I revert this patch the test no longer fails: https://review.openstack.org/#/c/432176/

It seems that the except block in _store() was dropped and likely handled this exception in the past.

description: updated
Revision history for this message
Corey Bryant (corey.bryant) wrote :

Looking at this some more, it may just need some better mocking in the test.

It looks like 'AttributeError: __exit__' is coming from session being an object that doesn't implement a context manager (https://docs.python.org/2.7/library/stdtypes.html#context-manager-types).

Looking at the traceback, the session object comes from the context (session = context.session), and context appears to come from stack.context (self.context = stack.context). stack.context.session likely may just need to be mocked in test_check.

Rico Lin (rico-lin)
Changed in heat:
milestone: none → no-priority-tag-bugs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.