Dell SC: Add exclude_domain_ip option

If a domain iscsi portal should NOT be returned this allows
the user to specify that. Otherwise all domains are returned.

DocImpact
Closes-Bug: #1616499
Change-Id: Iaec89db402acb759304ea1d3fbb239ee73e4340e
(cherry-picked from commit 5fe72f8fb4)
This commit is contained in:
Tom Swanson 2016-08-23 11:23:09 -05:00
parent 2a7da4f627
commit 235594652b
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,6 +1506,7 @@ class StorageCenterApi(object):
controller or not.
:return: Nothing
"""
if self.excluded_domain_ips.count(address) == 0:
portals.append(address + ':' +
six.text_type(port))
iqns.append(iqn)

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__)