summaryrefslogtreecommitdiffstats
path: root/backend.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-07-05 21:23:35 +0000
committerDavid Cantrell <dcantrell@redhat.com>2007-07-05 21:23:35 +0000
commit9bcc95e248e94c477219088f08db946444b42094 (patch)
treeca51fc00b1528b87de872e7ea40b448d6a7e483c /backend.py
parent9ceaa453d5708fc76e3fb5697d34b6586bf8b11a (diff)
downloadanaconda-9bcc95e248e94c477219088f08db946444b42094.tar.gz
anaconda-9bcc95e248e94c477219088f08db946444b42094.tar.xz
anaconda-9bcc95e248e94c477219088f08db946444b42094.zip
* backend.py (AnacondaBackend.doPostInstall): Remove multipath post
install work (generate bindings and edit multipath.conf) because it needs to take place before packages are installed (#185852). * yuminstall.py (YumBackend.doPreInstall): Generate multipath bindings and correct multipath.conf before package installation begins. Use scsi_id to read WWID of each multipath slave and use that to populate the bindings file and blacklist_exceptions block in multipath.conf (#185852).
Diffstat (limited to 'backend.py')
-rw-r--r--backend.py107
1 files changed, 0 insertions, 107 deletions
diff --git a/backend.py b/backend.py
index 239e2e9e6..3ac8a62f0 100644
--- a/backend.py
+++ b/backend.py
@@ -65,113 +65,6 @@ class AnacondaBackend:
if flags.setupFilesystems:
syslog.stop()
- # disable multipath boot features if system isn't using multipath
- if not flags.mpath:
- mpfile = self.instPath + "/etc/sysconfig/mkinitrd/multipath"
- leading = os.path.dirname(mpfile)
-
- if not os.path.isdir(leading):
- os.makedirs(leading, mode=0755)
-
- f = open(mpfile, "w")
- f.write("MULTIPATH=no\n")
- f.close()
- os.chmod(mpfile, 0755)
-
- # make sure multipath bindings file exists on final system
- bindings = '/var/lib/multipath/bindings'
- wwids = []
- if flags.mpath:
- if not os.path.isfile(bindings):
- d = os.path.dirname(bindings)
-
- if not os.path.isdir(d):
- os.makedirs(d, mode=0755)
-
- for entry in anaconda.id.fsset.entries:
- dev = entry.device.getDevice()
- if dev.find('mapper/mpath') != -1:
- fulldev = "/dev/%s" % (dev,)
- rc = iutil.execWithRedirect("/sbin/multipath",
- ["-v", "0", fulldev],
- stdout = "/dev/tty5",
- stderr = "/dev/tty5")
-
- if os.path.isfile(bindings):
- leading = self.instPath + os.path.dirname(bindings)
-
- if not os.path.isdir(leading):
- os.makedirs(leading, mode=0755)
-
- shutil.copy2(bindings, leading + '/bindings')
-
- # read in WWIDs per mpath device
- f = open(bindings, 'r')
- lines = map(lambda s: s[:-1], f.readlines())
- f.close()
-
- for l in lines:
- if l.strip().startswith('mpath'):
- try:
- i = l.index(' ')
- wwid = l[i:].strip()
- wwids.append(wwid)
- except:
- pass
-
- # since all devices are blacklisted by default, add a
- # blacklist_exception block for the devices we want treated as
- # multipath devices --dcantrell (BZ #243527)
- mpconf = self.instPath + "/etc/multipath.conf"
- if flags.mpath:
- f = open(mpconf, "r")
- # remove newline from the end of each line
- mplines = map(lambda s: s[:-1], f.readlines())
- f.close()
-
- f = open(mpconf, "w")
-
- blacklist = False
- depth = 0
- for line in mplines:
- if line.strip().startswith('#'):
- f.write("%s\n" % (line,))
- else:
- if blacklist:
- depth += line.count('{')
- depth -= line.count('}')
- f.write("#%s\n" % (line,))
-
- if depth == 0:
- blacklist = False
-
- # write out the catch-all blacklist section to
- # blacklist all device types
- f.write('\nblacklist {\n')
- f.write(' devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"\n')
- f.write(' devnode "^(hd|xvd)[a-z]*"\n')
- f.write(' wwid "*"\n')
- f.write('}\n')
-
- # write out the blacklist exceptions with
- # multipath WWIDs
- if wwids != []:
- f.write('\n# Make sure our multipath devices are enabled.\n')
- f.write('\nblacklist_exception {\n')
-
- for wwid in wwids:
- f.write(" wwid \"%s\"\n" % (wwid,))
-
- f.write('}\n\n')
- else:
- if line.strip().startswith('blacklist'):
- depth += line.count('{')
- depth -= line.count('}')
- blacklist = True
- f.write("#%s\n" % (line,))
- else:
- f.write("%s\n" % (line,))
-
def doInstall(self, anaconda):
pass