ScaleIO: More connection info backward compatibility
Similar to I6f01a178616b74ed9a86876ca46e7e46eb360518, this patch
fixes a compatibility issue when the new connection properties
dictionary exists, but is missing the 'failed_over' field. This
situation may arise when booting a shelved instance whose connection
properties were created prior to when the ScaleIO driver was enhanced
to support replication failover.
Related-Bug: #1823200
Change-Id: I9b2a9cd2839a4efec824fc68cb2163ad70f4ebdc
(cherry picked from commit f8de43834b
)
This commit is contained in:
parent
574d277246
commit
9317f9facb
|
@ -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 "
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue