Merge "ScaleIO: More connection info backward compatibility" into stable/victoria

This commit is contained in:
Zuul 2021-03-02 17:28:30 +00:00 committed by Gerrit Code Review
commit a280d9f771
2 changed files with 12 additions and 1 deletions

View File

@ -100,7 +100,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
password = priv_scaleio.get_connector_password(
CONNECTOR_CONF_PATH,
connection_properties['config_group'],
connection_properties['failed_over'])
connection_properties.get('failed_over', False))
return password, None
except Exception as e:
msg = _("Error getting ScaleIO connector password from "

View File

@ -320,3 +320,14 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
mock_device_size.return_value)
self.rescan_vols_mock.assert_called_once_with(
self.connector.RESCAN_VOLS_OP_CODE)
def test_connection_properties_without_failed_over(self):
"""Handle connection properties with 'failed_over' missing"""
connection_properties = dict(self.fake_connection_properties)
connection_properties.pop('failed_over')
self.connector.connect_volume(connection_properties)
self.get_password_mock.assert_called_once_with(
scaleio.CONNECTOR_CONF_PATH,
connection_properties['config_group'],
False)