Fix wrong use of six.moves.queue.get()
timeout is not the first positional argument. Change-Id: Icd745514adc14730b9179fa7a6dd5c115f5e87a5 Closes-Bug: #1625604
This commit is contained in:
parent
86f7cfefb0
commit
a01ca10250
|
@ -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 "
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue