Merge "Follow Up: Generalizing is_replicated_str to is_boolean_str"

This commit is contained in:
Zuul 2018-12-07 11:09:06 +00:00 committed by Gerrit Code Review
commit 02dfd34b84
3 changed files with 6 additions and 6 deletions

View File

@ -783,9 +783,9 @@ class VMAXUtils(object):
:param new_type_extra_specs: the target type extra specs
:return: bool
"""
is_src_multiattach = vol_utils.is_replicated_str(
is_src_multiattach = vol_utils.is_boolean_str(
extra_specs.get('multiattach'))
is_tgt_multiattach = vol_utils.is_replicated_str(
is_tgt_multiattach = vol_utils.is_boolean_str(
new_type_extra_specs.get('multiattach'))
return is_src_multiattach != is_tgt_multiattach

View File

@ -2839,7 +2839,7 @@ class VolumeManager(manager.CleanableManager,
replication_diff = diff_specs.get('replication_enabled')
if replication_diff:
is_replicated = vol_utils.is_replicated_str(replication_diff[1])
is_replicated = vol_utils.is_boolean_str(replication_diff[1])
if is_replicated:
replication_status = fields.ReplicationStatus.ENABLED
else:

View File

@ -968,7 +968,7 @@ def clone_encryption_key(context, key_manager, encryption_key_id):
return clone_key_id
def is_replicated_str(str):
def is_boolean_str(str):
spec = (str or '').split()
return (len(spec) == 2 and
spec[0] == '<is>' and strutils.bool_from_string(spec[1]))
@ -976,12 +976,12 @@ def is_replicated_str(str):
def is_replicated_spec(extra_specs):
return (extra_specs and
is_replicated_str(extra_specs.get('replication_enabled')))
is_boolean_str(extra_specs.get('replication_enabled')))
def is_multiattach_spec(extra_specs):
return (extra_specs and
is_replicated_str(extra_specs.get('multiattach')))
is_boolean_str(extra_specs.get('multiattach')))
def group_get_by_id(group_id):