コード例 #1
0
 def __init__(self, group):
     gid = group.get('group_type_id')
     specs = group_types.get_group_type_specs(gid) if gid else {}
     self.type_cg_snapshot = specs.get(
         'consistent_group_snapshot_enabled', '<is> %s' %
         EXTRA_SPECS_DEFAULTS['consistent_group_snapshot_enabled']).upper(
         ) == strings.METADATA_IS_TRUE
コード例 #2
0
ファイル: utils.py プロジェクト: lubidl0/cinder-1
def get_group_specs(group, spec_key):
    spec_value = None
    if group.group_type_id:
        group_specs = group_types.get_group_type_specs(group.group_type_id)
        if spec_key in group_specs:
            spec_value = group_specs[spec_key]
    return spec_value
コード例 #3
0
    def from_group(cls, group):
        group_specs = {}

        if group and group.group_type_id:
            group_specs = group_types.get_group_type_specs(group.group_type_id)

        return cls(extra_specs={}, group_specs=group_specs)
コード例 #4
0
ファイル: utils.py プロジェクト: neilqing/cinder
def is_group_a_type(group, key):
    if group.group_type_id is not None:
        spec = group_types.get_group_type_specs(
            group.group_type_id, key=key
        )
        return spec == "<is> True"
    return False
コード例 #5
0
ファイル: utils.py プロジェクト: j-griffith/cinder
def is_group_a_type(group, key):
    if group.group_type_id is not None:
        spec = group_types.get_group_type_specs(
            group.group_type_id, key=key
        )
        return spec == "<is> True"
    return False
コード例 #6
0
def is_group_a_cg_snapshot_type(group_or_snap):
    LOG.debug("Checking if %s is a consistent snapshot group", group_or_snap)
    if group_or_snap["group_type_id"] is not None:
        spec = group_types.get_group_type_specs(
            group_or_snap["group_type_id"],
            key="consistent_group_snapshot_enabled")
        return spec == "<is> True"
    return False
コード例 #7
0
ファイル: common.py プロジェクト: j-griffith/cinder
    def from_group(cls, group):
        group_specs = {}

        if group and group.group_type_id:
            group_specs = group_types.get_group_type_specs(
                group.group_type_id)

        return cls(extra_specs={}, group_specs=group_specs)
コード例 #8
0
ファイル: utils.py プロジェクト: j-griffith/cinder
def is_group_a_cg_snapshot_type(group_or_snap):
    LOG.debug("Checking if %s is a consistent snapshot group",
              group_or_snap)
    if group_or_snap["group_type_id"] is not None:
        spec = group_types.get_group_type_specs(
            group_or_snap["group_type_id"],
            key="consistent_group_snapshot_enabled"
        )
        return spec == "<is> True"
    return False