Merge "Dell SC: Add exclude_domain_ip option" into stable/mitaka

This commit is contained in:
Jenkins 2016-09-13 18:59:00 +00:00 committed by Gerrit Code Review
commit a1b912dfa0
2 changed files with 30 additions and 20 deletions

View File

@ -190,6 +190,9 @@ class StorageCenterApiHelper(object):
# about.
connection.vfname = self.config.dell_sc_volume_folder
connection.sfname = self.config.dell_sc_server_folder
connection.excluded_domain_ips = self.config.excluded_domain_ip
if not connection.excluded_domain_ips:
connection.excluded_domain_ips = []
# Set appropriate ssn and failover state.
if self.active_backend_id:
# active_backend_id is a string. Convert to int.
@ -252,6 +255,7 @@ class StorageCenterApi(object):
self.failed_over = False
self.vfname = 'openstack'
self.sfname = 'openstack'
self.excluded_domain_ips = []
self.legacypayloadfilters = False
self.consisgroups = True
self.apiversion = apiversion
@ -1502,27 +1506,28 @@ class StorageCenterApi(object):
controller or not.
:return: Nothing
"""
portals.append(address + ':' +
six.text_type(port))
iqns.append(iqn)
luns.append(lun)
if self.excluded_domain_ips.count(address) == 0:
portals.append(address + ':' +
six.text_type(port))
iqns.append(iqn)
luns.append(lun)
# We've all the information. We need to find
# the best single portal to return. So check
# this one if it is on the right IP, port and
# if the access and status are correct.
if ((pdata['ip'] is None or pdata['ip'] == address) and
(pdata['port'] is None or pdata['port'] == port)):
# We've all the information. We need to find
# the best single portal to return. So check
# this one if it is on the right IP, port and
# if the access and status are correct.
if ((pdata['ip'] is None or pdata['ip'] == address) and
(pdata['port'] is None or pdata['port'] == port)):
# We need to point to the best link.
# So state active and status up is preferred
# but we don't actually need the state to be
# up at this point.
if pdata['up'] == -1:
if active:
pdata['active'] = len(iqns) - 1
if status == 'Up':
pdata['up'] = pdata['active']
# We need to point to the best link.
# So state active and status up is preferred
# but we don't actually need the state to be
# up at this point.
if pdata['up'] == -1:
if active:
pdata['active'] = len(iqns) - 1
if status == 'Up':
pdata['up'] = pdata['active']
# Start by getting our mappings.
mappings = self._find_mappings(scvolume)

View File

@ -13,6 +13,7 @@
# under the License.
from oslo_config import cfg
from oslo_config import types
from oslo_log import log as logging
from oslo_utils import excutils
@ -39,7 +40,11 @@ common_opts = [
help='Name of the volume folder to use on the Storage Center'),
cfg.BoolOpt('dell_sc_verify_cert',
default=False,
help='Enable HTTPS SC certificate verification.')
help='Enable HTTPS SC certificate verification'),
cfg.MultiOpt('excluded_domain_ip',
item_type=types.IPAddress(),
default=None,
help='Domain IP to be excluded from iSCSI returns.')
]
LOG = logging.getLogger(__name__)