コード例 #1
0
ファイル: lvm.py プロジェクト: andrewlukoshko/vdsm
def removeVgMapping(vgName):
    """
    Removes the mapping of the specified volume group.
    Utilizes the fact that the mapping created by the LVM looks like that
    e45c12b0--f520--498a--82bb--c6cb294b990f-master
    i.e vg name concatenated with volume name (dash is escaped with dash)
    """
    mappingPrefix = getLvDmName(vgName, "")
    mappings = devicemapper.getAllMappedDevices()

    for mapping in mappings:
        if not mapping.startswith(mappingPrefix):
            continue
        try:
            devicemapper.removeMapping(mapping)
        except Exception:
            pass
コード例 #2
0
ファイル: lvm.py プロジェクト: xin49/vdsm
def removeVgMapping(vgName):
    """
    Removes the mapping of the specified volume group.
    Utilizes the fact that the mapping created by the LVM looks like that
    e45c12b0--f520--498a--82bb--c6cb294b990f-master
    i.e vg name concatenated with volume name (dash is escaped with dash)
    """
    mappingPrefix = getLvDmName(vgName, "")
    mappings = devicemapper.getAllMappedDevices()

    for mapping in mappings:
        if not mapping.startswith(mappingPrefix):
            continue
        try:
            devicemapper.removeMapping(mapping)
        except Exception:
            pass
コード例 #3
0
def devicemapper_removeMapping(deviceName):
    return devicemapper.removeMapping(deviceName)
コード例 #4
0
def test_remove_mapping(zero_dm_device):
    device_path = "{}{}".format(DMPATH_PREFIX, zero_dm_device)
    assert os.path.exists(device_path)

    devicemapper.removeMapping(zero_dm_device)
    assert not os.path.exists(device_path)