Fix Py27/35 jenkins failure

the newest pymongo lib break our CI, because that we
did the circular reference for db table creation.

This patch fixd the circular reference bug.

Change-Id: Ie91b3c029776c6142d36d8a058fd96d2c4d75f6f
This commit is contained in:
wangxiyuan 2017-08-29 09:56:40 +08:00
parent 45d59d662a
commit 546375844a
2 changed files with 5 additions and 4 deletions

View File

@ -73,10 +73,11 @@ class ControllerBaseTest(testing.TestBase):
db_name = "zaqar_test_pools_" + str(i)
# NOTE(dynarro): we need to create a unique uri.
uri = "%s/%s" % (uri, db_name)
new_uri = "%s/%s" % (uri, db_name)
options = {'database': db_name}
self.control.pools_controller.create(six.text_type(i),
100, uri, options=options)
100, new_uri,
options=options)
self.driver = self.driver_class(self.conf, cache, self.control)
self.addCleanup(self.control.pools_controller.drop_all)
self.addCleanup(self.control.catalogue_controller.drop_all)

View File

@ -44,9 +44,9 @@ class TestMessagesMongoDB(base.V2Base):
for i in range(4):
db_name = "zaqar_test_pools_" + str(i)
# NOTE(dynarro): we need to create a unique uri.
uri = "%s/%s" % (uri, db_name)
new_uri = "%s/%s" % (uri, db_name)
options = {'database': db_name}
doc = {'weight': 100, 'uri': uri, 'options': options}
doc = {'weight': 100, 'uri': new_uri, 'options': options}
self.simulate_put(self.url_prefix + '/pools/' + str(i),
body=jsonutils.dumps(doc))
self.assertEqual(falcon.HTTP_201, self.srmock.status)