summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2012-10-12 12:36:24 -0500
committerDavid Lehman <dlehman@redhat.com>2012-10-15 11:48:22 -0500
commite875a5aaaf74c32b1e0938e465a02a4ed123e4d7 (patch)
treefeb06a9110e12ef8b03592759ac6fa7ebc2c1379
parentb412c255d1843bb05b45c0ba04a64ca136788176 (diff)
downloadanaconda-e875a5aaaf74c32b1e0938e465a02a4ed123e4d7.tar.gz
anaconda-e875a5aaaf74c32b1e0938e465a02a4ed123e4d7.tar.xz
anaconda-e875a5aaaf74c32b1e0938e465a02a4ed123e4d7.zip
Honor the nompath option.
-rw-r--r--pyanaconda/storage/devicelibs/mpath.py12
-rw-r--r--pyanaconda/storage/devicetree.py9
2 files changed, 14 insertions, 7 deletions
diff --git a/pyanaconda/storage/devicelibs/mpath.py b/pyanaconda/storage/devicelibs/mpath.py
index 6b088963f..2e5efd16b 100644
--- a/pyanaconda/storage/devicelibs/mpath.py
+++ b/pyanaconda/storage/devicelibs/mpath.py
@@ -3,6 +3,7 @@ import re
from ..udev import udev_device_is_disk
from pyanaconda import iutil
+from pyanaconda.flags import flags
from pyanaconda.anaconda_log import log_method_call
import logging
@@ -266,6 +267,17 @@ blacklist {
return ret
+ def writeConfig(self, friendly_names=True):
+ if not flags.mpath:
+ # not writing out a multipath.conf will effectively blacklist all
+ # mpath which will prevent any of them from being activated during
+ # install
+ return
+
+ cfg = self.write(friendly_names)
+ with open("/etc/multipath.conf", "w+") as mpath_cfg:
+ mpath_cfg.write(cfg)
+
def flush_mpaths():
iutil.execWithRedirect("multipath", ["-F"])
check_output = iutil.execWithCapture("multipath", ["-ll"]).strip()
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index a5c69832e..2d30ae4d0 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1883,13 +1883,10 @@ class DeviceTree(object):
self.liveBackingDevice = live_device_name
break
- cfg = self.__multipathConfigWriter.write(self.mpathFriendlyNames)
old_devices = {}
if os.access("/etc/multipath.conf", os.W_OK):
- with open("/etc/multipath.conf", "w+") as mpath_cfg:
- mpath_cfg.write(cfg)
-
+ self.__multipathConfigWriter.writeConfig(self.mpathFriendlyNames)
self.topology = devicelibs.mpath.MultipathTopology(udev_get_block_devices())
log.info("devices to scan: %s" %
[d['name'] for d in self.topology.devices_iter()])
@@ -1926,9 +1923,7 @@ class DeviceTree(object):
for d in self.devices:
if not d.name in whitelist:
self.__multipathConfigWriter.addBlacklistDevice(d)
- cfg = self.__multipathConfigWriter.write(self.mpathFriendlyNames)
- with open("/etc/multipath.conf", "w+") as mpath_cfg:
- mpath_cfg.write(cfg)
+ self.__multipathConfigWriter.writeConfig(self.mpathFriendlyNames)
else:
log.info("Skipping multipath detection due to running as non-root.")