Merge "Stop using deprecated zake coordination driver"

This commit is contained in:
Zuul 2024-01-30 02:26:23 +00:00 committed by Gerrit Code Review
commit 69c6b12a8d
2 changed files with 9 additions and 3 deletions

View File

@ -14,6 +14,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
import shutil
import tempfile
from unittest import mock from unittest import mock
from oslo_config import fixture as cfg_fixture from oslo_config import fixture as cfg_fixture
@ -34,7 +36,10 @@ class TestCoordination(oslotest.base.BaseTestCase):
self.useFixture(cfg_fixture.Config(CONF)) self.useFixture(cfg_fixture.Config(CONF))
self.name = 'coordination' self.name = 'coordination'
self.tg = mock.Mock() self.tg = mock.Mock()
CONF.set_override('backend_url', 'zake://', group='coordination') self.tempdir = tempfile.mkdtemp()
CONF.set_override('backend_url', "file://%s" % self.tempdir,
group='coordination')
self.addCleanup(shutil.rmtree, self.tempdir, ignore_errors=True)
def test_retry_if_tooz_error(self): def test_retry_if_tooz_error(self):
self.assertFalse(coordination._retry_if_tooz_error(Exception())) self.assertFalse(coordination._retry_if_tooz_error(Exception()))
@ -158,10 +163,12 @@ class TestCoordination(oslotest.base.BaseTestCase):
class TestPartitioner(oslotest.base.BaseTestCase): class TestPartitioner(oslotest.base.BaseTestCase):
def setUp(self): def setUp(self):
super().setUp() super().setUp()
self.tempdir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.tempdir, ignore_errors=True)
def _get_partitioner(self, partitions, host=b'a'): def _get_partitioner(self, partitions, host=b'a'):
fixture = self.useFixture(base_fixtures.CoordinatorFixture( fixture = self.useFixture(base_fixtures.CoordinatorFixture(
'zake://', host) "file://%s" % self.tempdir, host)
) )
group = 'group' group = 'group'
fixture.coordinator.create_group(group) fixture.coordinator.create_group(group)

View File

@ -15,7 +15,6 @@ WebTest>=2.0.27 # MIT
tempest>=21.0.0 # Apache-2.0 tempest>=21.0.0 # Apache-2.0
# Bandit security code scanner # Bandit security code scanner
bandit>=1.1.0 # Apache-2.0 bandit>=1.1.0 # Apache-2.0
zake>=0.1.6 # Apache-2.0
doc8>=0.6.0 # Apache-2.0 doc8>=0.6.0 # Apache-2.0
Pygments>=2.2.0 # BSD license Pygments>=2.2.0 # BSD license
pymemcache!=1.3.0,>=1.2.9 # Apache 2.0 License pymemcache!=1.3.0,>=1.2.9 # Apache 2.0 License