Merge "Remove mirror policy parameter from Huawei driver"

This commit is contained in:
Jenkins 2017-04-06 08:17:09 +00:00 committed by Gerrit Code Review
commit 08eb26589e
5 changed files with 6 additions and 9 deletions

View File

@ -73,7 +73,6 @@ class HuaweiConf(object):
self._lun_copy_wait_interval,
self._lun_timeout,
self._lun_write_type,
self._lun_mirror_switch,
self._lun_prefetch,
self._lun_policy,
self._lun_read_cache_policy,
@ -175,11 +174,6 @@ class HuaweiConf(object):
write_type = text.strip() if text else '1'
setattr(self.conf, 'lun_write_type', write_type)
def _lun_mirror_switch(self, xml_root):
text = xml_root.findtext('LUN/MirrorSwitch')
mirror_switch = text.strip() if text else '1'
setattr(self.conf, 'lun_mirror_switch', mirror_switch)
def _lun_prefetch(self, xml_root):
prefetch_type = '3'
prefetch_value = '0'

View File

@ -332,7 +332,6 @@ class HuaweiBaseDriver(driver.VolumeDriver):
'ALLOCTYPE': opts.get('LUNType', self.configuration.lun_type),
'CAPACITY': huawei_utils.get_volume_size(volume),
'WRITEPOLICY': self.configuration.lun_write_type,
'MIRRORPOLICY': self.configuration.lun_mirror_switch,
'PREFETCHPOLICY': self.configuration.lun_prefetch_type,
'PREFETCHVALUE': self.configuration.lun_prefetch_value,
'DATATRANSFERPOLICY':
@ -688,7 +687,6 @@ class HuaweiBaseDriver(driver.VolumeDriver):
'ALLOCTYPE': opts.get('LUNType', lun_info['ALLOCTYPE']),
'CAPACITY': lun_info['CAPACITY'],
'WRITEPOLICY': lun_info['WRITEPOLICY'],
'MIRRORPOLICY': lun_info['MIRRORPOLICY'],
'PREFETCHPOLICY': lun_info['PREFETCHPOLICY'],
'PREFETCHVALUE': lun_info['PREFETCHVALUE'],
'DATATRANSFERPOLICY': policy,

View File

@ -411,7 +411,6 @@ class ReplicaPairManager(object):
'ALLOCTYPE': local_lun_info['ALLOCTYPE'],
'CAPACITY': local_lun_info['CAPACITY'],
'WRITEPOLICY': self.conf.lun_write_type,
'MIRRORPOLICY': self.conf.lun_mirror_switch,
'PREFETCHPOLICY': self.conf.lun_prefetch_type,
'PREFETCHVALUE': self.conf.lun_prefetch_value,
'DATATRANSFERPOLICY': self.conf.lun_policy,

View File

@ -213,6 +213,8 @@ class RestClient(object):
raise exception.VolumeBackendAPIException(data=err_msg)
def create_lun(self, lun_params):
# Set the mirror switch always on
lun_params['MIRRORPOLICY'] = '1'
url = "/lun"
result = self.call(url, lun_params)
if result['error']['code'] == constants.ERROR_VOLUME_ALREADY_EXIST:

View File

@ -0,0 +1,4 @@
---
deprecations:
- |
Remove mirror policy parameter from huawei driver.