Remove mirror policy parameter from Huawei driver

Mirror policy parameter is not supposed to be exposed to users.
This patch removes it.

Change-Id: Ifaccbd8ba2939da446144d26299d62c71d2f0249
Closes-Bug: #1676796
This commit is contained in:
zengyingzhe 2017-03-28 17:23:31 +08:00 committed by Yingzhe Zeng
parent 5d10ed5367
commit 6e74dbd4c3
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

@ -321,7 +321,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':
@ -677,7 +676,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

@ -204,6 +204,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.