summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2010-01-25 15:54:37 -0500
committerPeter Jones <pjones@redhat.com>2010-02-26 11:25:01 -0500
commit74e65cbf111a4f17fa393192519910de53d6c7ac (patch)
tree73b0669d92cb90bbe294c5b4e200468d921fc32e
parentda94cbb1cb7eb6c096d115a3cf4895712e9885a0 (diff)
downloadanaconda-74e65cbf111a4f17fa393192519910de53d6c7ac.tar.gz
anaconda-74e65cbf111a4f17fa393192519910de53d6c7ac.tar.xz
anaconda-74e65cbf111a4f17fa393192519910de53d6c7ac.zip
Write a multipath.conf before probing for mpaths.
If we don't have a multipath.conf when we scan, we get a default blacklist of everything, which isn't helpful. So write one.
-rw-r--r--storage/devicelibs/mpath.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/devicelibs/mpath.py b/storage/devicelibs/mpath.py
index adb2644f3..75911c9a1 100644
--- a/storage/devicelibs/mpath.py
+++ b/storage/devicelibs/mpath.py
@@ -1,5 +1,6 @@
from ..udev import *
import iutil
+import os
def parseMultipathOutput(output):
# this function parses output from "multipath -d", so we can use its
@@ -61,6 +62,11 @@ def identifyMultipaths(devices):
# [sda, sdd], [[sdb, sdc]], [sr0, sda1, sdd1, sdd2]]
log.info("devices to scan for multipath: %s" % [d['name'] for d in devices])
+ if not os.path.exists("/etc/multipath.conf"):
+ cfg = MultipathConfigWriter().write()
+ open("/etc/multipath.conf", "w+").write(cfg)
+ del cfg
+
topology = parseMultipathOutput(iutil.execWithCapture("multipath", ["-d",]))
# find the devices that aren't in topology, and add them into it...
topodevs = reduce(lambda x,y: x.union(y), topology.values(), set())