Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Cloud:OpenStack:Newton:Staging
openstack-neutron
0001-Fix-wrong-use-of-six.moves.queue.get.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Fix-wrong-use-of-six.moves.queue.get.patch of Package openstack-neutron
From a01ca102500cb4705c6c4d8e10180931aa7d5056 Mon Sep 17 00:00:00 2001 From: Hong Hui Xiao <honghui_xiao@yeah.net> Date: Tue, 20 Sep 2016 20:15:21 +0800 Subject: [PATCH] Fix wrong use of six.moves.queue.get() timeout is not the first positional argument. Change-Id: Icd745514adc14730b9179fa7a6dd5c115f5e87a5 Closes-Bug: #1625604 --- neutron/agent/ovsdb/impl_idl.py | 2 +- neutron/tests/unit/agent/ovsdb/test_impl_idl.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/neutron/agent/ovsdb/impl_idl.py b/neutron/agent/ovsdb/impl_idl.py index aa0de3ff0e..d946712f1c 100644 --- a/neutron/agent/ovsdb/impl_idl.py +++ b/neutron/agent/ovsdb/impl_idl.py @@ -64,7 +64,7 @@ class Transaction(api.Transaction): def commit(self): self.ovsdb_connection.queue_txn(self) try: - result = self.results.get(self.timeout) + result = self.results.get(timeout=self.timeout) except Queue.Empty: raise api.TimeoutException( _("Commands %(commands)s exceeded timeout %(timeout)d " diff --git a/neutron/tests/unit/agent/ovsdb/test_impl_idl.py b/neutron/tests/unit/agent/ovsdb/test_impl_idl.py index ccff6c3d0f..5d2a3e6a98 100644 --- a/neutron/tests/unit/agent/ovsdb/test_impl_idl.py +++ b/neutron/tests/unit/agent/ovsdb/test_impl_idl.py @@ -13,7 +13,6 @@ # under the License. import mock -from six.moves import queue import testtools from neutron.agent.ovsdb import api @@ -23,10 +22,9 @@ from neutron.tests import base class TransactionTestCase(base.BaseTestCase): def test_commit_raises_exception_on_timeout(self): - with mock.patch.object(queue, 'Queue') as mock_queue: - transaction = impl_idl.NeutronOVSDBTransaction(mock.sentinel, - mock.Mock(), 0) - mock_queue.return_value.get.side_effect = queue.Empty + transaction = impl_idl.NeutronOVSDBTransaction(mock.sentinel, + mock.Mock(), 1) + with self.assert_max_execution_time(10): with testtools.ExpectedException(api.TimeoutException): transaction.commit() -- 2.19.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor