--- blivet/devicelibs/mpath.py | 15 +++++++++++++++ blivet/devicetree.py | 3 +++ blivet/flags.py | 3 +++ 3 files changed, 21 insertions(+)
diff --git a/blivet/devicelibs/mpath.py b/blivet/devicelibs/mpath.py index 673f9e6..3f108a3 100644 --- a/blivet/devicelibs/mpath.py +++ b/blivet/devicelibs/mpath.py @@ -12,3 +12,18 @@ def flush_mpaths():
def is_multipath_member(path): return (util.run_program(["multipath", "-c", path]) == 0) + +def set_friendly_names(enabled=True): + """ Set the state of friendly names in multipathd. + + NOTE: If you call this you also need to take appropriate steps to make + sure the devicetree contains devices with the appropriate names. + They will not be updated automatically. + """ + if enabled: + val = "y" + else: + val = "n" + + cmd = ["mpathconf", "--user_friendly_names", val, "--with_multipathd", "y"] + return (util.run_program(cmd) == 0) diff --git a/blivet/devicetree.py b/blivet/devicetree.py index 39e756c..7bb746f 100644 --- a/blivet/devicetree.py +++ b/blivet/devicetree.py @@ -1865,6 +1865,9 @@ class DeviceTree(object): log.info("DeviceTree.populate: ignoredDisks is %s ; exclusiveDisks is %s" % (self.ignoredDisks, self.exclusiveDisks))
+ if flags.installer_mode: + devicelibs.mpath.set_friendly_names(enabled=flags.multipath_friendly_names) + self.setupDiskImages()
# mark the tree as unpopulated so exception handlers can tell the diff --git a/blivet/flags.py b/blivet/flags.py index d7af82d..b10f725 100644 --- a/blivet/flags.py +++ b/blivet/flags.py @@ -54,6 +54,8 @@ class Flags(object):
self.gpt = False
+ self.multipath_friendly_names = True + # whether to include nodev filesystems in the devicetree (only # meaningful when flags.installer_mode is False) self.include_nodev = False @@ -98,5 +100,6 @@ class Flags(object): self.arm_platform = anaconda_flags.armPlatform self.gpt = anaconda_flags.gpt
+ self.multipath_friendly_names = anaconda_flags.mpathFriendlyNames
flags = Flags()