This replaces the checkbutton from rhel6 with a command line option to disable friendly names. Multipathd makes this nice and simple for us.
--- anaconda | 3 +++ pyanaconda/flags.py | 1 + 2 files changed, 4 insertions(+)
diff --git a/anaconda b/anaconda index d8c4fbd..5c1ea2d 100755 --- a/anaconda +++ b/anaconda @@ -305,6 +305,7 @@ def parseOptions(argv=None, cmdline=None): op.add_option("--noeject", action="store_false", dest="eject", default=True) op.add_option("--extlinux", action="store_true", default=False) op.add_option("--dnf", action="store_true", default=False) + op.add_option("--mpathfriendlynames", action="store_true", default=True)
# some defaults change based on cmdline flags if cmdline is not None: @@ -847,6 +848,8 @@ if __name__ == "__main__": if opts.dnf: flags.dnf = opts.dnf
+ flags.mpathFriendlyNames = opts.mpathfriendlynames + # set flags flags.dmraid = opts.dmraid flags.mpath = opts.mpath diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py index 530a950..de6ec88 100644 --- a/pyanaconda/flags.py +++ b/pyanaconda/flags.py @@ -70,6 +70,7 @@ class Flags(object): self.leavebootorder = False self.testing = False self.dnf = False + self.mpathFriendlyNames = True # ksprompt is whether or not to prompt for missing ksdata self.ksprompt = True # parse the boot commandline
On Wed, Sep 18, 2013 at 09:45:34AM -0500, David Lehman wrote:
anaconda | 3 +++ pyanaconda/flags.py | 1 + 2 files changed, 4 insertions(+)
diff --git a/anaconda b/anaconda index d8c4fbd..5c1ea2d 100755 --- a/anaconda +++ b/anaconda @@ -305,6 +305,7 @@ def parseOptions(argv=None, cmdline=None): op.add_option("--noeject", action="store_false", dest="eject", default=True) op.add_option("--extlinux", action="store_true", default=False) op.add_option("--dnf", action="store_true", default=False)
- op.add_option("--mpathfriendlynames", action="store_true", default=True)
I think this will result in not being able to be set False.
--- 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()
On Wed, 2013-09-18 at 09:45 -0500, David Lehman wrote:
This replaces the checkbutton from rhel6 with a command line option to disable friendly names. Multipathd makes this nice and simple for us.
These both look good to me.
anaconda-patches@lists.fedorahosted.org