Minutes after committing c5b49fe5c62a7f062fd4d19c157e481fc514f584 I realized 'sda' would also filter out the partition 'sdap4' on the disk 'sdap', not desirable. This patch essentialy reverts c5b49fe5c62a7f062fd4d19c157e481fc514f584. It goes through all partitions of a mpath member at the moment we check it's ignored and adds the partitions explicitly to the filter list. Related: rhbz#624175 --- storage/devicelibs/lvm.py | 14 ++++---------- storage/devicetree.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/storage/devicelibs/lvm.py b/storage/devicelibs/lvm.py index 80228d7..0482cd5 100644 --- a/storage/devicelibs/lvm.py +++ b/storage/devicelibs/lvm.py @@ -23,9 +23,10 @@ import os import math import re -import string import iutil +import logging +log = logging.getLogger("storage") from ..errors import * from constants import * @@ -74,15 +75,7 @@ def _composeConfig(): rejects = config_args_data["filterRejects"] for reject in rejects: - # If reject is "sda" we want both "sda" and "sda10" rejected but not - # "sdab". If reject is "sda1" we want precisely "sda1" rejected and not - # "sda10" - if reject[-1] in string.digits: - # ends with a digit - filter_string += ("\"r|/%s$|\"," % reject) - else: - # doesn't end with a digit so also match any number of digits - filter_string += ("\"r|/%s%s$|\"," % (reject, r'p?[0-9]*')) + filter_string += ("\"r|/%s$|\"," % reject) filter_string = " filter=[%s] " % filter_string.strip(",") @@ -101,6 +94,7 @@ def _composeConfig(): def lvm_cc_addFilterRejectRegexp(regexp): """ Add a regular expression to the --config string.""" global config_args_data + log.debug("lvm filter: adding %s to the reject list" % regexp) config_args_data["filterRejects"].append(regexp) # compoes config once more. diff --git a/storage/devicetree.py b/storage/devicetree.py index 56c14f1..3cdc281 100644 --- a/storage/devicetree.py +++ b/storage/devicetree.py @@ -38,6 +38,7 @@ import devicelibs.mpath from udev import * from .storage_log import log_method_call import iutil +import parted import gettext _ = lambda x: gettext.ldgettext("anaconda", x) @@ -1246,6 +1247,23 @@ class DeviceTree(object): if self.isIgnored(info): log.debug("ignoring %s (%s)" % (name, sysfs_path)) + if udev_device_is_multipath_member(info): + # last time we are seeing this mpath member is now, so make sure + # LVM ignores its partitions too else a duplicate VG name could + # harm us later during partition creation: + if udev_device_is_dm(info): + path = "/dev/mapper/%s" % name + else: + path = "/dev/%s" % name + log.debug("adding partitions on %s to the lvm ignore list" % path) + partitions_paths = [] + try: + partitions_paths = [p.path + for p in parted.Disk(device=parted.Device(path=path)).partitions] + except (_ped.IOException, _ped.DeviceException) as e: + log.error("Parted error scanning partitions on %s:" % path) + log.error(str(e)) + map(lvm.lvm_cc_addFilterRejectRegexp, partition_paths) return log.debug("scanning %s (%s)..." % (name, sysfs_path)) -- 1.7.1.1 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list