--- storage/devicelibs/swap.py | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/storage/devicelibs/swap.py b/storage/devicelibs/swap.py index d037d80..02a07d4 100644 --- a/storage/devicelibs/swap.py +++ b/storage/devicelibs/swap.py @@ -26,6 +26,7 @@ import iutil import os from ..errors import * +from . import dm import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -100,13 +101,20 @@ def swapoff(device): raise SwapError("swapoff failed for '%s'" % device) def swapstatus(device): + alt_dev = device + if device.startswith("/dev/mapper/"): + # get the real device node for device-mapper devices since the ones + # with meaningful names are just symlinks + alt_dev = "/dev/%s" % dm.dm_node_from_name(device.split("/")[-1]) + lines = open("/proc/swaps").readlines() status = False for line in lines: if not line.strip(): continue - - if line.split()[0] == device: + + swap_dev = line.split()[0] + if swap_dev in [device, alt_dev]: status = True break -- 1.6.6 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list