Add iscsi port to sf_svip arg if not provided

With things like VLAN support it may be necessary for
an admin to specify the sf_svip (IP) address.  The problem
is that when this is specified if the admin forgets to include
the port suffix to the SVIP address it may not work on certain
distros (inparticular RHEL variants).

This patch just adds a simple check when the endpoint is created
to make sure the port suffix is included, if it's not it
automatically adds the default 3260.

NOTE: This is not a backport, the Cheesecake code has an
inadvertent fix (albeit it could be improved) that didn't
merge in Mitaka.

Change-Id: Id2a99ff927d1fb9e40fab10beb0db5e4f302ae70
Closes-Bug: #1619941
This commit is contained in:
John Griffith 2016-09-14 11:13:14 -06:00
parent 9aaaf7e2e9
commit da77382f32

View File

@ -411,9 +411,16 @@ class SolidFireDriver(san.SanISCSIDriver):
"""Gets the connection info for specified account and volume.""" """Gets the connection info for specified account and volume."""
cluster_info = self._get_cluster_info() cluster_info = self._get_cluster_info()
if self.configuration.sf_svip is None: if self.configuration.sf_svip is None:
iscsi_portal = cluster_info['clusterInfo']['svip'] + ':3260' iscsi_portal = cluster_info['clusterInfo']['svip']
else: else:
iscsi_portal = self.configuration.sf_svip iscsi_portal = self.configuration.sf_svip
# NOTE(jdg): some systems get irritated if there's no
# port indicated, and we don't enforce it on the config
# option so add the default here if it's missing
if ':' not in iscsi_portal:
iscsi_portal += ':3260'
chap_secret = sfaccount['targetSecret'] chap_secret = sfaccount['targetSecret']
found_volume = False found_volume = False