Skip to content

Commit f48625c

Browse files
authored
Merge pull request #49 from bingyanh/2.6.1_master
update 2.6.1
2 parents 2c45700 + 6b1e33c commit f48625c

File tree

162 files changed

+1906
-482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+1906
-482
lines changed

Cinder/Mitaka/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.5.RC4"""
1+
"""Version: 2.6.1"""

Cinder/Mitaka/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
3535
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
3636
QOS_NAME_PREFIX = 'OpenStack_'
37+
SENSITIVE_KEYS = ['auth_password']
38+
3739
PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
3840
FC_PORT_CONNECTED = '10'
3941
FC_INIT_ONLINE = '27'

Cinder/Mitaka/huawei_driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282

8383
class HuaweiBaseDriver(driver.VolumeDriver):
84+
VERSION = "2.6.1"
8485

8586
def __init__(self, *args, **kwargs):
8687
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
@@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
29672968
2.2.RC1 - Add force delete volume
29682969
"""
29692970

2970-
VERSION = "2.5.RC4"
29712971

29722972
def __init__(self, *args, **kwargs):
29732973
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
30123012
connector, iscsi_info, rmt_iscsi_info)
30133013

30143014
LOG.info('initialize_common_connection_iscsi, '
3015-
'return data is: %s.', iscsi_info)
3015+
'return data is: %s.',
3016+
huawei_utils.mask_dict_sensitive_info(iscsi_info))
30163017
return iscsi_info
30173018

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

3295-
VERSION = "2.5.RC4"
32963296

32973297
def __init__(self, *args, **kwargs):
32983298
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

Cinder/Mitaka/huawei_utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from oslo_log import log as logging
2222
from oslo_service import loopingcall
2323
from oslo_utils import units
24+
from oslo_utils import strutils
2425

2526
from cinder import exception
2627
from cinder.i18n import _
@@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
348349
"specified at the same volume_type.")
349350
LOG.error(msg)
350351
raise exception.VolumeBackendAPIException(data=msg)
352+
353+
354+
def mask_dict_sensitive_info(data, secret="***"):
355+
# mask sensitive data in the dictionary
356+
if not isinstance(data, dict):
357+
return data
358+
359+
out = {}
360+
for key, value in data.items():
361+
if isinstance(value, dict):
362+
value = mask_dict_sensitive_info(value, secret=secret)
363+
elif key in constants.SENSITIVE_KEYS:
364+
value = secret
365+
out[key] = value
366+
367+
return strutils.mask_dict_password(out)
368+

Cinder/Mitaka/rest_client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,19 +2216,19 @@ def get_fc_initiator_on_array(self):
22162216

22172217
return fc_initiators
22182218

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

2229-
msg = _('get_hyper_domain_id error.')
2230-
self._assert_rest_result(result, msg)
2231-
return domain_id
2226+
def get_hyper_domain_id(self, domain_name):
2227+
domain_list = self._get_info_by_range(self._get_hypermetro_domain)
2228+
for item in domain_list:
2229+
if domain_name == item.get('NAME'):
2230+
return item.get("ID")
2231+
return None
22322232

22332233
def create_hypermetro(self, hcp_param):
22342234
url = "/HyperMetroPair"

Cinder/Newton/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.5.RC4"""
1+
"""Version: 2.6.1"""

Cinder/Newton/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
3535
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
3636
QOS_NAME_PREFIX = 'OpenStack_'
37+
SENSITIVE_KEYS = ['auth_password']
38+
3739
PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
3840
FC_PORT_CONNECTED = '10'
3941
FC_INIT_ONLINE = '27'

Cinder/Newton/huawei_driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282

8383
class HuaweiBaseDriver(driver.VolumeDriver):
84+
VERSION = "2.6.1"
8485

8586
def __init__(self, *args, **kwargs):
8687
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
@@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
29672968
2.2.RC1 - Add force delete volume
29682969
"""
29692970

2970-
VERSION = "2.5.RC4"
29712971

29722972
def __init__(self, *args, **kwargs):
29732973
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
30123012
connector, iscsi_info, rmt_iscsi_info)
30133013

30143014
LOG.info('initialize_common_connection_iscsi, '
3015-
'return data is: %s.', iscsi_info)
3015+
'return data is: %s.',
3016+
huawei_utils.mask_dict_sensitive_info(iscsi_info))
30163017
return iscsi_info
30173018

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

3295-
VERSION = "2.5.RC4"
32963296

32973297
def __init__(self, *args, **kwargs):
32983298
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

Cinder/Newton/huawei_utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from oslo_log import log as logging
2222
from oslo_service import loopingcall
2323
from oslo_utils import units
24+
from oslo_utils import strutils
2425

2526
from cinder import exception
2627
from cinder.i18n import _
@@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
348349
"specified at the same volume_type.")
349350
LOG.error(msg)
350351
raise exception.VolumeBackendAPIException(data=msg)
352+
353+
354+
def mask_dict_sensitive_info(data, secret="***"):
355+
# mask sensitive data in the dictionary
356+
if not isinstance(data, dict):
357+
return data
358+
359+
out = {}
360+
for key, value in data.items():
361+
if isinstance(value, dict):
362+
value = mask_dict_sensitive_info(value, secret=secret)
363+
elif key in constants.SENSITIVE_KEYS:
364+
value = secret
365+
out[key] = value
366+
367+
return strutils.mask_dict_password(out)
368+

Cinder/Newton/rest_client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,19 +2216,19 @@ def get_fc_initiator_on_array(self):
22162216

22172217
return fc_initiators
22182218

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

2229-
msg = _('get_hyper_domain_id error.')
2230-
self._assert_rest_result(result, msg)
2231-
return domain_id
2226+
def get_hyper_domain_id(self, domain_name):
2227+
domain_list = self._get_info_by_range(self._get_hypermetro_domain)
2228+
for item in domain_list:
2229+
if domain_name == item.get('NAME'):
2230+
return item.get("ID")
2231+
return None
22322232

22332233
def create_hypermetro(self, hcp_param):
22342234
url = "/HyperMetroPair"

Cinder/Ocata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.5.RC4"""
1+
"""Version: 2.6.1"""

Cinder/Ocata/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
3535
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
3636
QOS_NAME_PREFIX = 'OpenStack_'
37+
SENSITIVE_KEYS = ['auth_password']
38+
3739
PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
3840
FC_PORT_CONNECTED = '10'
3941
FC_INIT_ONLINE = '27'

Cinder/Ocata/huawei_driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282

8383
class HuaweiBaseDriver(driver.VolumeDriver):
84+
VERSION = "2.6.1"
8485

8586
def __init__(self, *args, **kwargs):
8687
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
@@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
29672968
2.2.RC1 - Add force delete volume
29682969
"""
29692970

2970-
VERSION = "2.5.RC4"
29712971

29722972
def __init__(self, *args, **kwargs):
29732973
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
30123012
connector, iscsi_info, rmt_iscsi_info)
30133013

30143014
LOG.info('initialize_common_connection_iscsi, '
3015-
'return data is: %s.', iscsi_info)
3015+
'return data is: %s.',
3016+
huawei_utils.mask_dict_sensitive_info(iscsi_info))
30163017
return iscsi_info
30173018

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

3295-
VERSION = "2.5.RC4"
32963296

32973297
def __init__(self, *args, **kwargs):
32983298
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

Cinder/Ocata/huawei_utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from oslo_log import log as logging
2222
from oslo_service import loopingcall
2323
from oslo_utils import units
24+
from oslo_utils import strutils
2425

2526
from cinder import exception
2627
from cinder.i18n import _
@@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
348349
"specified at the same volume_type.")
349350
LOG.error(msg)
350351
raise exception.VolumeBackendAPIException(data=msg)
352+
353+
354+
def mask_dict_sensitive_info(data, secret="***"):
355+
# mask sensitive data in the dictionary
356+
if not isinstance(data, dict):
357+
return data
358+
359+
out = {}
360+
for key, value in data.items():
361+
if isinstance(value, dict):
362+
value = mask_dict_sensitive_info(value, secret=secret)
363+
elif key in constants.SENSITIVE_KEYS:
364+
value = secret
365+
out[key] = value
366+
367+
return strutils.mask_dict_password(out)
368+

Cinder/Ocata/rest_client.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2216,19 +2216,19 @@ def get_fc_initiator_on_array(self):
22162216

22172217
return fc_initiators
22182218

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

2229-
msg = _('get_hyper_domain_id error.')
2230-
self._assert_rest_result(result, msg)
2231-
return domain_id
2226+
def get_hyper_domain_id(self, domain_name):
2227+
domain_list = self._get_info_by_range(self._get_hypermetro_domain)
2228+
for item in domain_list:
2229+
if domain_name == item.get('NAME'):
2230+
return item.get("ID")
2231+
return None
22322232

22332233
def create_hypermetro(self, hcp_param):
22342234
url = "/HyperMetroPair"

Cinder/Pike/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Version: 2.5.RC4"""
1+
"""Version: 2.6.1"""

Cinder/Pike/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
MAPPING_VIEW_PREFIX = 'OpenStack_Mapping_View_'
3535
PORTGROUP_PREFIX = 'OpenStack_PortGroup_'
3636
QOS_NAME_PREFIX = 'OpenStack_'
37+
SENSITIVE_KEYS = ['auth_password']
38+
3739
PORTGROUP_DESCRIP_PREFIX = "Please do NOT modify this. Engine ID: "
3840
FC_PORT_CONNECTED = '10'
3941
FC_INIT_ONLINE = '27'

Cinder/Pike/huawei_driver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181

8282

8383
class HuaweiBaseDriver(driver.VolumeDriver):
84+
VERSION = "2.6.1"
8485

8586
def __init__(self, *args, **kwargs):
8687
super(HuaweiBaseDriver, self).__init__(*args, **kwargs)
@@ -2967,7 +2968,6 @@ class HuaweiISCSIDriver(HuaweiBaseDriver, driver.ISCSIDriver):
29672968
2.2.RC1 - Add force delete volume
29682969
"""
29692970

2970-
VERSION = "2.5.RC4"
29712971

29722972
def __init__(self, *args, **kwargs):
29732973
super(HuaweiISCSIDriver, self).__init__(*args, **kwargs)
@@ -3012,7 +3012,8 @@ def _initialize_connection_lock(self, volume, connector):
30123012
connector, iscsi_info, rmt_iscsi_info)
30133013

30143014
LOG.info('initialize_common_connection_iscsi, '
3015-
'return data is: %s.', iscsi_info)
3015+
'return data is: %s.',
3016+
huawei_utils.mask_dict_sensitive_info(iscsi_info))
30163017
return iscsi_info
30173018

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

3295-
VERSION = "2.5.RC4"
32963296

32973297
def __init__(self, *args, **kwargs):
32983298
super(HuaweiFCDriver, self).__init__(*args, **kwargs)

Cinder/Pike/huawei_utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from oslo_log import log as logging
2222
from oslo_service import loopingcall
2323
from oslo_utils import units
24+
from oslo_utils import strutils
2425

2526
from cinder import exception
2627
from cinder.i18n import _
@@ -348,3 +349,20 @@ def check_group_volume_type_valid(opt):
348349
"specified at the same volume_type.")
349350
LOG.error(msg)
350351
raise exception.VolumeBackendAPIException(data=msg)
352+
353+
354+
def mask_dict_sensitive_info(data, secret="***"):
355+
# mask sensitive data in the dictionary
356+
if not isinstance(data, dict):
357+
return data
358+
359+
out = {}
360+
for key, value in data.items():
361+
if isinstance(value, dict):
362+
value = mask_dict_sensitive_info(value, secret=secret)
363+
elif key in constants.SENSITIVE_KEYS:
364+
value = secret
365+
out[key] = value
366+
367+
return strutils.mask_dict_password(out)
368+

0 commit comments

Comments
 (0)