From bdfafcdada6c4912c7bc93c59c9690a18296dc8a Mon Sep 17 00:00:00 2001 From: Goutham Pacha Ravi Date: Tue, 11 Oct 2022 13:49:55 -0700 Subject: [PATCH] Set configured_ip_versions fact in cephfs driver Without it, we lose the memoization optimization in the "get_configured_ip_versions" method, and cause a warning log to be emitted one too many times than desired. Change-Id: Ibd05406b4af7c99795f1bca2d4989790430b616b Closes-Bug: #1991776 Signed-off-by: Goutham Pacha Ravi --- manila/share/drivers/cephfs/driver.py | 2 +- manila/tests/share/drivers/cephfs/test_driver.py | 2 ++ ...1776-cephfs-configured-ip-versions-fd87976fdb848e8c.yaml | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/bug-1991776-cephfs-configured-ip-versions-fd87976fdb848e8c.yaml diff --git a/manila/share/drivers/cephfs/driver.py b/manila/share/drivers/cephfs/driver.py index 4e3eb0b0af..37e8935e31 100644 --- a/manila/share/drivers/cephfs/driver.py +++ b/manila/share/drivers/cephfs/driver.py @@ -1033,7 +1033,7 @@ class NFSProtocolHelperMixin(): "a hostname (rather than IP address) was supplied " "in 'cephfs_ganesha_server_ip' or " "in 'cephfs_ganesha_export_ips'.") - return [4, 6] + self.configured_ip_versions = {4, 6} return list(self.configured_ip_versions) diff --git a/manila/tests/share/drivers/cephfs/test_driver.py b/manila/tests/share/drivers/cephfs/test_driver.py index 101a832b7a..2106aa8e0b 100644 --- a/manila/tests/share/drivers/cephfs/test_driver.py +++ b/manila/tests/share/drivers/cephfs/test_driver.py @@ -1115,6 +1115,8 @@ class NFSProtocolHelperTestCase(test.TestCase): self.assertEqual(set(configured_ip_version), set(helper.get_configured_ip_versions())) + self.assertEqual(set(configured_ip_version), + helper.configured_ip_versions) def test_get_configured_ip_versions_already_set(self): fake_conf = configuration.Configuration(None) diff --git a/releasenotes/notes/bug-1991776-cephfs-configured-ip-versions-fd87976fdb848e8c.yaml b/releasenotes/notes/bug-1991776-cephfs-configured-ip-versions-fd87976fdb848e8c.yaml new file mode 100644 index 0000000000..cd3972b8ef --- /dev/null +++ b/releasenotes/notes/bug-1991776-cephfs-configured-ip-versions-fd87976fdb848e8c.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + `Bug 1991776 `_ was fixed within the + CephFS driver. The driver no longer emits repeated warnings concerning + supported IP versions when using the NFS protocol.