40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
# File '../../src/include/partitioning/lvm_ui_dialogs.rb', line 40
def HandleRemoveLv(targetMap, id)
targetMap = deep_copy(targetMap)
ret = false
disk = Storage.GetDisk(targetMap, id)
_Lv = Storage.GetPartition(targetMap, id)
if Builtins.size(_Lv) == 0 || _Lv == nil ||
Ops.get_symbol(_Lv, "type", :primary) != :lvm
Popup.Error(_("You can only remove logical volumes."))
elsif Builtins.find(Ops.get_list(disk, "partitions", [])) do |p|
Ops.get_string(p, "origin", "") == Ops.get_string(_Lv, "name", "")
end != nil
Popup.Error(
_(
"There is at least one snapshot active for this volume.\nRemove the snapshot first."
)
)
elsif Builtins.find(Ops.get_list(disk, "partitions", [])) do |p|
Ops.get_string(p, "used_pool", "") == Ops.get_string(_Lv, "name", "")
end != nil
Popup.Error(
_(
"There is at least one thin volume using this pool.\nRemove the thin volume first."
)
)
else
message = Builtins.sformat(_("Remove the logical volume %1?"), id)
ret = Storage.DeleteDevice(id) if Popup.YesNo(message)
end
Builtins.y2milestone("HandleRemoveLv ret:%1", ret)
ret
end
|