From d7f7b6312a3529f6f23cc541114594308f85e1af Mon Sep 17 00:00:00 2001 From: Nilesh Thathagar Date: Wed, 12 Jun 2024 10:01:25 +0000 Subject: [PATCH] Dell PowerFlex: Set default value for port config Added default port value for the Dell PowerFlex NAS backend Closes-Bug: #2066840 Change-Id: Ifda8c0b179763fe0884ef3845b6836be861ca6a8 --- .../share/drivers/dell_emc/plugins/powerflex/connection.py | 6 +++--- .../drivers/dell_emc/plugins/powerflex/test_connection.py | 2 +- ...66840-dell-powerflex-default-port-fc50b82979e3b11b.yaml | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/bug-2066840-dell-powerflex-default-port-fc50b82979e3b11b.yaml diff --git a/manila/share/drivers/dell_emc/plugins/powerflex/connection.py b/manila/share/drivers/dell_emc/plugins/powerflex/connection.py index fa441d8837..3f2b59bf77 100644 --- a/manila/share/drivers/dell_emc/plugins/powerflex/connection.py +++ b/manila/share/drivers/dell_emc/plugins/powerflex/connection.py @@ -44,7 +44,8 @@ POWERFLEX_OPTS = [ help='Protection domain to use.'), cfg.StrOpt('dell_nas_backend_host', help='Dell NAS backend hostname or IP address.'), - cfg.StrOpt('dell_nas_backend_port', + cfg.IntOpt('dell_nas_backend_port', + default=443, help='Port number to use with the Dell NAS backend.'), cfg.StrOpt('dell_nas_server', help='Root directory or NAS server which owns the shares.'), @@ -100,8 +101,7 @@ class PowerFlexStorageConnection(driver.StorageConnection): get_config_value = config.safe_get self.verify_certificate = get_config_value("dell_ssl_cert_verify") self.rest_ip = get_config_value("dell_nas_backend_host") - self.rest_port = (int(get_config_value("dell_nas_backend_port")) or - 443) + self.rest_port = get_config_value("dell_nas_backend_port") self.nas_server = get_config_value("dell_nas_server") self.storage_pool = get_config_value("powerflex_storage_pool") self.protection_domain = get_config_value( diff --git a/manila/tests/share/drivers/dell_emc/plugins/powerflex/test_connection.py b/manila/tests/share/drivers/dell_emc/plugins/powerflex/test_connection.py index 244aaeeed7..38ce19fb70 100644 --- a/manila/tests/share/drivers/dell_emc/plugins/powerflex/test_connection.py +++ b/manila/tests/share/drivers/dell_emc/plugins/powerflex/test_connection.py @@ -47,7 +47,7 @@ class PowerFlexTest(test.TestCase): if value == "dell_nas_backend_host": return "192.168.0.110" elif value == "dell_nas_backend_port": - return "443" + return 443 elif value == "dell_nas_login": return "admin" elif value == "dell_nas_password": diff --git a/releasenotes/notes/bug-2066840-dell-powerflex-default-port-fc50b82979e3b11b.yaml b/releasenotes/notes/bug-2066840-dell-powerflex-default-port-fc50b82979e3b11b.yaml new file mode 100644 index 0000000000..2b9a41390d --- /dev/null +++ b/releasenotes/notes/bug-2066840-dell-powerflex-default-port-fc50b82979e3b11b.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + PowerFlex Driver `bug #2066840 + `_: + The default port value of 443 has been added for + the PowerFlex NAS backend.