From d3c48523ccd07a9edd4f2d705ba5d573d52191e1 Mon Sep 17 00:00:00 2001 From: Brian Rosmaita Date: Thu, 30 Mar 2023 06:34:56 -0400 Subject: [PATCH] Don't use deprecated config opt name in unit test With cinder change Iccfbe62406b6, the 'iscsi_secondary_ip_addresses' opt was deprecated in favor of 'target_secondary_ip_addresses'. This broke a cinderlib unit test that checked to see if a mocked logger was not called (which it now was, to log a deprecation message). Use the current option name in the test so that the test continues to test what it was designed to test (i.e., cinderlib config loading, not oslo.config option deprecation). Change-Id: Ia243368a9d68aca3a717fb2be1da99bceb271e56 --- cinderlib/tests/unit/test_cinderlib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinderlib/tests/unit/test_cinderlib.py b/cinderlib/tests/unit/test_cinderlib.py index 83d8f5d..2db015e 100644 --- a/cinderlib/tests/unit/test_cinderlib.py +++ b/cinderlib/tests/unit/test_cinderlib.py @@ -286,7 +286,7 @@ class TestCinderlib(base.BaseTest): cinder_cfg = { 'volume_driver': 'cinder.volume.drivers.lvm.LVMVolumeDriver', 'volume_group': 'lvm-volumes', - 'iscsi_secondary_ip_addresses': ['w.x.y.z', 'a.b.c.d'], + 'target_secondary_ip_addresses': ['w.x.y.z', 'a.b.c.d'], 'target_port': 12345, } expected_cfg = cinder_cfg.copy() @@ -297,7 +297,7 @@ class TestCinderlib(base.BaseTest): self.assertEqual('cinder-volumes', cfg.CONF.backend_defaults.volume_group) self.assertEqual( - [], cfg.CONF.backend_defaults.iscsi_secondary_ip_addresses) + [], cfg.CONF.backend_defaults.target_secondary_ip_addresses) self.assertEqual(3260, cfg.CONF.backend_defaults.target_port) self.assertEqual(expected_cfg, cinder_cfg)