Skip to content

Commit

Permalink
Merge pull request #49 from bingyanh/2.6.1_master
Browse files Browse the repository at this point in the history
update 2.6.1
  • Loading branch information
yunqifeng authored Jul 9, 2023
2 parents 2c45700 + 6b1e33c commit f48625c
Show file tree
Hide file tree
Showing 162 changed files with 1,906 additions and 482 deletions.
2 changes: 1 addition & 1 deletion Cinder/Mitaka/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.5.RC4"""
"""Version: 2.6.1"""
2 changes: 2 additions & 0 deletions Cinder/Mitaka/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
QOS_NAME_PREFIX = 'OpenStack_'
SENSITIVE_KEYS = ['auth_password']

PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
FC_PORT_CONNECTED = '10'
FC_INIT_ONLINE = '27'
Expand Down
6 changes: 3 additions & 3 deletions Cinder/Mitaka/huawei_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@


class HuaweiBaseDriver(driver.VolumeDriver):
VERSION = "2.6.1"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
connector, iscsi_info, rmt_iscsi_info)

LOG.info('initialize_common_connection_iscsi, '
'return data is: %s.', iscsi_info)
'return data is: %s.',
huawei_utils.mask_dict_sensitive_info(iscsi_info))
return iscsi_info

def _initialize_connection(self, volume, connector, local=True):
Expand Down Expand Up @@ -3292,7 +3293,6 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiFCDriver, self).__init__(*args, **kwargs)
Expand Down
18 changes: 18 additions & 0 deletions Cinder/Mitaka/huawei_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_utils import units
from oslo_utils import strutils

from cinder import exception
from cinder.i18n import _
Expand Down Expand Up @@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
"specified at the same volume_type.")
LOG.error(msg)
raise exception.VolumeBackendAPIException(data=msg)


def mask_dict_sensitive_info(data, secret="***"):
# mask sensitive data in the dictionary
if not isinstance(data, dict):
return data

out = {}
for key, value in data.items():
if isinstance(value, dict):
value = mask_dict_sensitive_info(value, secret=secret)
elif key in constants.SENSITIVE_KEYS:
value = secret
out[key] = value

return strutils.mask_dict_password(out)

22 changes: 11 additions & 11 deletions Cinder/Mitaka/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2216,19 +2216,19 @@ def get_fc_initiator_on_array(self):

return fc_initiators

def get_hyper_domain_id(self, domain_name):
url = "/HyperMetroDomain?range=[0-32]"
def _get_hypermetro_domain(self, start, end, params):
url = ("/HyperMetroDomain?range=[%(start)s-%(end)s]"
% {"start": str(start), "end": str(end)})
result = self.call(url, None, "GET")
domain_id = None
if "data" in result:
for item in result['data']:
if domain_name == item['NAME']:
domain_id = item['ID']
break
self._assert_rest_result(result, "Get hyper domain info error.")
return result.get('data', [])

msg = _('get_hyper_domain_id error.')
self._assert_rest_result(result, msg)
return domain_id
def get_hyper_domain_id(self, domain_name):
domain_list = self._get_info_by_range(self._get_hypermetro_domain)
for item in domain_list:
if domain_name == item.get('NAME'):
return item.get("ID")
return None

def create_hypermetro(self, hcp_param):
url = "/HyperMetroPair"
Expand Down
2 changes: 1 addition & 1 deletion Cinder/Newton/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.5.RC4"""
"""Version: 2.6.1"""
2 changes: 2 additions & 0 deletions Cinder/Newton/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
QOS_NAME_PREFIX = 'OpenStack_'
SENSITIVE_KEYS = ['auth_password']

PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
FC_PORT_CONNECTED = '10'
FC_INIT_ONLINE = '27'
Expand Down
6 changes: 3 additions & 3 deletions Cinder/Newton/huawei_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@


class HuaweiBaseDriver(driver.VolumeDriver):
VERSION = "2.6.1"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
connector, iscsi_info, rmt_iscsi_info)

LOG.info('initialize_common_connection_iscsi, '
'return data is: %s.', iscsi_info)
'return data is: %s.',
huawei_utils.mask_dict_sensitive_info(iscsi_info))
return iscsi_info

def _initialize_connection(self, volume, connector, local=True):
Expand Down Expand Up @@ -3292,7 +3293,6 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiFCDriver, self).__init__(*args, **kwargs)
Expand Down
18 changes: 18 additions & 0 deletions Cinder/Newton/huawei_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_utils import units
from oslo_utils import strutils

from cinder import exception
from cinder.i18n import _
Expand Down Expand Up @@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
"specified at the same volume_type.")
LOG.error(msg)
raise exception.VolumeBackendAPIException(data=msg)


def mask_dict_sensitive_info(data, secret="***"):
# mask sensitive data in the dictionary
if not isinstance(data, dict):
return data

out = {}
for key, value in data.items():
if isinstance(value, dict):
value = mask_dict_sensitive_info(value, secret=secret)
elif key in constants.SENSITIVE_KEYS:
value = secret
out[key] = value

return strutils.mask_dict_password(out)

22 changes: 11 additions & 11 deletions Cinder/Newton/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2216,19 +2216,19 @@ def get_fc_initiator_on_array(self):

return fc_initiators

def get_hyper_domain_id(self, domain_name):
url = "/HyperMetroDomain?range=[0-32]"
def _get_hypermetro_domain(self, start, end, params):
url = ("/HyperMetroDomain?range=[%(start)s-%(end)s]"
% {"start": str(start), "end": str(end)})
result = self.call(url, None, "GET")
domain_id = None
if "data" in result:
for item in result['data']:
if domain_name == item['NAME']:
domain_id = item['ID']
break
self._assert_rest_result(result, "Get hyper domain info error.")
return result.get('data', [])

msg = _('get_hyper_domain_id error.')
self._assert_rest_result(result, msg)
return domain_id
def get_hyper_domain_id(self, domain_name):
domain_list = self._get_info_by_range(self._get_hypermetro_domain)
for item in domain_list:
if domain_name == item.get('NAME'):
return item.get("ID")
return None

def create_hypermetro(self, hcp_param):
url = "/HyperMetroPair"
Expand Down
2 changes: 1 addition & 1 deletion Cinder/Ocata/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.5.RC4"""
"""Version: 2.6.1"""
2 changes: 2 additions & 0 deletions Cinder/Ocata/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
QOS_NAME_PREFIX = 'OpenStack_'
SENSITIVE_KEYS = ['auth_password']

PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
FC_PORT_CONNECTED = '10'
FC_INIT_ONLINE = '27'
Expand Down
6 changes: 3 additions & 3 deletions Cinder/Ocata/huawei_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@


class HuaweiBaseDriver(driver.VolumeDriver):
VERSION = "2.6.1"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
connector, iscsi_info, rmt_iscsi_info)

LOG.info('initialize_common_connection_iscsi, '
'return data is: %s.', iscsi_info)
'return data is: %s.',
huawei_utils.mask_dict_sensitive_info(iscsi_info))
return iscsi_info

def _initialize_connection(self, volume, connector, local=True):
Expand Down Expand Up @@ -3292,7 +3293,6 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiFCDriver, self).__init__(*args, **kwargs)
Expand Down
18 changes: 18 additions & 0 deletions Cinder/Ocata/huawei_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_utils import units
from oslo_utils import strutils

from cinder import exception
from cinder.i18n import _
Expand Down Expand Up @@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
"specified at the same volume_type.")
LOG.error(msg)
raise exception.VolumeBackendAPIException(data=msg)


def mask_dict_sensitive_info(data, secret="***"):
# mask sensitive data in the dictionary
if not isinstance(data, dict):
return data

out = {}
for key, value in data.items():
if isinstance(value, dict):
value = mask_dict_sensitive_info(value, secret=secret)
elif key in constants.SENSITIVE_KEYS:
value = secret
out[key] = value

return strutils.mask_dict_password(out)

22 changes: 11 additions & 11 deletions Cinder/Ocata/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2216,19 +2216,19 @@ def get_fc_initiator_on_array(self):

return fc_initiators

def get_hyper_domain_id(self, domain_name):
url = "/HyperMetroDomain?range=[0-32]"
def _get_hypermetro_domain(self, start, end, params):
url = ("/HyperMetroDomain?range=[%(start)s-%(end)s]"
% {"start": str(start), "end": str(end)})
result = self.call(url, None, "GET")
domain_id = None
if "data" in result:
for item in result['data']:
if domain_name == item['NAME']:
domain_id = item['ID']
break
self._assert_rest_result(result, "Get hyper domain info error.")
return result.get('data', [])

msg = _('get_hyper_domain_id error.')
self._assert_rest_result(result, msg)
return domain_id
def get_hyper_domain_id(self, domain_name):
domain_list = self._get_info_by_range(self._get_hypermetro_domain)
for item in domain_list:
if domain_name == item.get('NAME'):
return item.get("ID")
return None

def create_hypermetro(self, hcp_param):
url = "/HyperMetroPair"
Expand Down
2 changes: 1 addition & 1 deletion Cinder/Pike/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Version: 2.5.RC4"""
"""Version: 2.6.1"""
2 changes: 2 additions & 0 deletions Cinder/Pike/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
QOS_NAME_PREFIX = 'OpenStack_'
SENSITIVE_KEYS = ['auth_password']

PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
FC_PORT_CONNECTED = '10'
FC_INIT_ONLINE = '27'
Expand Down
6 changes: 3 additions & 3 deletions Cinder/Pike/huawei_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@


class HuaweiBaseDriver(driver.VolumeDriver):
VERSION = "2.6.1"

def __init__(self, *args, **kwargs):
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
Expand Down Expand Up @@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
connector, iscsi_info, rmt_iscsi_info)

LOG.info('initialize_common_connection_iscsi, '
'return data is: %s.', iscsi_info)
'return data is: %s.',
huawei_utils.mask_dict_sensitive_info(iscsi_info))
return iscsi_info

def _initialize_connection(self, volume, connector, local=True):
Expand Down Expand Up @@ -3292,7 +3293,6 @@ class HuaweiFCDriver(HuaweiBaseDriver, driver.FibreChannelDriver):
2.2.RC1 - Add force delete volume
"""

VERSION = "2.5.RC4"

def __init__(self, *args, **kwargs):
super(HuaweiFCDriver, self).__init__(*args, **kwargs)
Expand Down
18 changes: 18 additions & 0 deletions Cinder/Pike/huawei_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from oslo_log import log as logging
from oslo_service import loopingcall
from oslo_utils import units
from oslo_utils import strutils

from cinder import exception
from cinder.i18n import _
Expand Down Expand Up @@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
"specified at the same volume_type.")
LOG.error(msg)
raise exception.VolumeBackendAPIException(data=msg)


def mask_dict_sensitive_info(data, secret="***"):
# mask sensitive data in the dictionary
if not isinstance(data, dict):
return data

out = {}
for key, value in data.items():
if isinstance(value, dict):
value = mask_dict_sensitive_info(value, secret=secret)
elif key in constants.SENSITIVE_KEYS:
value = secret
out[key] = value

return strutils.mask_dict_password(out)

Loading

0 comments on commit f48625c

Please sign in to comment.