diff options
author | Chris Lumens <clumens@redhat.com> | 2005-08-12 17:02:54 +0000 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2005-08-12 17:02:54 +0000 |
commit | ad06ecd663388d31e24ed8a915cbb75c8c09e5e3 (patch) | |
tree | 7ec622b907c6b5ba672512bba993a0e109cfdb18 | |
parent | be9b1d17b23f3075f12a939cc7d11fe8687edcc9 (diff) | |
download | anaconda-ad06ecd663388d31e24ed8a915cbb75c8c09e5e3.tar.gz anaconda-ad06ecd663388d31e24ed8a915cbb75c8c09e5e3.tar.xz anaconda-ad06ecd663388d31e24ed8a915cbb75c8c09e5e3.zip |
Use new logging system.
48 files changed, 340 insertions, 266 deletions
@@ -1,3 +1,19 @@ +2005-08-12 Chris Lumens <clumens@redhat.com> + + * bootloader.py, desktop.py, exception.py, firewall.py, floppy.py, + fsset.py, harddrive.py, hdrlist.py, image.py, installclass.py, + installmethod.py, iutil.py, network.py, partRequests.py, + partedUtils.py, partitioning.py, partitions.py, pcmcia.py, raid.py, + rescue.py, security.py, syslogd.py, text.py, timezone.py, upgrade.py, + urlinstall.py, users.py, vnc.py, whiteout.py, yuminstall.py, zfcp.py, + iw/lvm_dialog_gui.py, iw/package_gui.py, iw/partition_gui.py, + iw/progress_gui.py, iw/upgrade_migratefs_gui.py, + iw/upgrade_swap_gui.py, iw/xconfig_gui.py, textw/bootloader_text.py, + textw/keyboard_text.py, textw/language_text.py, textw/network_text.py, + textw/packages_text.py, textw/partition_text.py, + textw/progress_text.py, textw/upgrade_text.py, textw/zfcp_text.py: + Use new logging system. + 2005-08-11 Chris Lumens <clumens@redhat.com> * anaconda: Use new logging system. diff --git a/bootloader.py b/bootloader.py index de9ca6665..5fa07d6b3 100644 --- a/bootloader.py +++ b/bootloader.py @@ -25,9 +25,11 @@ import string from flags import flags from constants import * -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + from booty import * from bootloaderInfo import * from fsset import * @@ -71,7 +73,7 @@ def bootloaderSetupChoices(dispatch, bl, fsset, diskSet, dir): # mbr and boot. boot is ALWAYS present. so if the dev isn't # listed, it was mbr and we should nicely fall back to boot if bl.defaultDevice not in keys: - log("MBR not suitable as boot device; installing to partition") + log.warning("MBR not suitable as boot device; installing to partition") bl.defaultDevice = "boot" bl.setDevice(choices[bl.defaultDevice][0]) elif choices and choices.has_key("mbr"): @@ -135,7 +137,7 @@ def writeBootloader(intf, instRoot, fsset, bl, langs, comps): otherList.append((label, longlabel, dev)) if kernelLabel is None: - log("unable to find default image, bailing") + log.error("unable to find default image, bailing") if not justConfigFile: w.pop() return diff --git a/desktop.py b/desktop.py index 8c17f9f82..9178c3d01 100644 --- a/desktop.py +++ b/desktop.py @@ -15,10 +15,11 @@ import string - -from rhpl.log import log from rhpl.simpleconfig import SimpleConfigFile +import logging +log = logging.getLogger("anaconda") + class Desktop (SimpleConfigFile): # # This class represents the default desktop to run and the default runlevel @@ -46,7 +47,7 @@ class Desktop (SimpleConfigFile): try: inittab = open (instPath + '/etc/inittab', 'r') except IOError: - log ("WARNING, there is no inittab, bad things will happen!") + log.warning ("there is no inittab, bad things will happen!") return lines = inittab.readlines () inittab.close () diff --git a/exception.py b/exception.py index 3d9274576..b630c4803 100644 --- a/exception.py +++ b/exception.py @@ -26,9 +26,11 @@ import bdb from string import joinfields from cPickle import Pickler from rhpl.translate import _ -from rhpl.log import log from flags import flags +import logging +log = logging.getLogger("anaconda") + dumpHash = {} # XXX do length limits on obj dumps. @@ -216,7 +218,7 @@ def handleException(dispatch, intf, (type, value, tb)): try: iutil.copyFile("/tmp/anacdump.txt", "/mnt/sysimage/root/anacdump.txt") except: - log("Failed to copy anacdump.txt to /mnt/sysimage/root") + log.error("Failed to copy anacdump.txt to /mnt/sysimage/root") pass # run kickstart traceback scripts (if necessary) @@ -242,7 +244,7 @@ def handleException(dispatch, intf, (type, value, tb)): try: iutil.copyFile("/tmp/anacdump.txt", "/tmp/test-anacdump.txt") except: - log("Failed to copy anacdump.txt to /tmp/test-anacdump.txt") + log.error("Failed to copy anacdump.txt to /tmp/test-anacdump.txt") pass intf.__del__ () @@ -289,7 +291,7 @@ def handleException(dispatch, intf, (type, value, tb)): try: iutil.copyFile("/tmp/anacdump.txt", "/tmp/crash/anacdump.txt") except: - log("Failed to copy anacdump.txt to floppy") + log.error("Failed to copy anacdump.txt to floppy") pass isys.umount("/tmp/crash") diff --git a/firewall.py b/firewall.py index 08f990248..48af04af3 100644 --- a/firewall.py +++ b/firewall.py @@ -19,9 +19,11 @@ import iutil import string from flags import flags -from rhpl.log import log from rhpl.translate import _, N_ +import logging +log = logging.getLogger("anaconda") + class Firewall: def __init__ (self): self.enabled = 1 @@ -66,11 +68,11 @@ class Firewall: iutil.execWithRedirect(args[0], args, root = instPath, stdout = None, stderr = None) else: - log("would have run %s", args) + log.error("would have run %s", args) except RuntimeError, msg: - log ("lokkit run failed: %s", msg) + log.error ("lokkit run failed: %s", msg) except OSError, (errno, msg): - log ("lokkit run failed: %s", msg) + log.error ("lokkit run failed: %s", msg) else: f = open(instPath + '/etc/sysconfig/system-config-securitylevel', 'w') @@ -23,9 +23,11 @@ import kudzu from constants import * from flags import flags -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + def hasFloppyDevice(): try: floppyDevices = 0 @@ -49,16 +51,16 @@ def probeFloppyDevice(): kudzu.PROBE_ALL) if not devices: - log("no floppy devices found but we'll try fd0 anyway") + log.warning("no floppy devices found but we'll try fd0 anyway") return fdDevice for device in devices: if device.detached: continue - log("anaconda floppy device %s" % (device.device)) + log.info("anaconda floppy device %s" % (device.device)) return device.device - log("anaconda floppy device is %s", fdDevice) + log.info("anaconda floppy device is %s", fdDevice) return fdDevice def makeBootdisk (intf, dir, floppyDevice, grpset, instPath, bootloader): @@ -80,7 +82,7 @@ def makeBootdisk (intf, dir, floppyDevice, grpset, instPath, bootloader): if os.access(kernel, os.R_OK): try: kernelsize = os.stat(kernel)[stat.ST_SIZE] - log("kernelsize is %s" %(kernelsize,)) + log.info("kernelsize is %s" %(kernelsize,)) except: kernelsize = 0 size = size + kernelsize @@ -89,12 +91,12 @@ def makeBootdisk (intf, dir, floppyDevice, grpset, instPath, bootloader): if os.access(initrd, os.R_OK): try: initrdsize = os.stat(initrd)[stat.ST_SIZE] - log("initrdsize is %s" %(initrdsize,) ) + log.info("initrdsize is %s" %(initrdsize,)) except: initrdsize = 0 size = size + initrdsize - log("boot floppy size is %s" %(size,)) + log.info("boot floppy size is %s" %(size,)) # go within 10 K of the size of the boot disk to have a tad # bit of safety. if this fails, we're no worse off than we used @@ -179,7 +181,7 @@ def makeBootdisk (intf, dir, floppyDevice, grpset, instPath, bootloader): if size != kernelsize: problem = 1 else: - log("unable to verify kernel size. hope it fit!") + log.warning("unable to verify kernel size. hope it fit!") else: problem = 1 @@ -28,9 +28,11 @@ import raid import lvm import types -from rhpl.log import log from rhpl.translate import _, N_ +import logging +log = logging.getLogger("anaconda") + class BadBlocksError(Exception): pass @@ -204,7 +206,7 @@ class FileSystemType: os.close(p[1]) os.close(fd) os.execv(args[0], args) - log("failed to exec %s", args) + log.critical("failed to exec %s", args) os._exit(1) os.close(p[1]) @@ -257,7 +259,8 @@ class FileSystemType: try: (pid, status) = os.waitpid(childpid, 0) except OSError, (num, msg): - log("exception from waitpid in badblocks: %s %s" % (num, msg)) + log.critical("exception from waitpid in badblocks: %s %s" + % (num, msg)) status = None os.close(fd) @@ -552,7 +555,7 @@ class extFileSystem(FileSystemType): args.extend(devArgs) args.extend(self.extraFormatArgs) - log("Format command: %s\n" % str(args)) + log.info("Format command: %s\n" % str(args)) rc = ext2FormatFilesystem(args, "/dev/tty5", progress, @@ -598,7 +601,7 @@ class ext2FileSystem(extFileSystem): # if journal already exists skip if isys.ext2HasJournal(devicePath, makeDevNode = 0): - log("Skipping migration of %s, has a journal already.\n" % devicePath) + log.info("Skipping migration of %s, has a journal already.\n" % devicePath) return rc = iutil.execWithRedirect("/usr/sbin/tune2fs", @@ -613,8 +616,8 @@ class ext2FileSystem(extFileSystem): # so several times based on reports in bugzilla. # At least we can avoid leaving them with a system which won't boot if not isys.ext2HasJournal(devicePath, makeDevNode = 0): - log("Migration of %s attempted but no journal exists after " - "running tune2fs.\n" % (devicePath)) + log.warning("Migration of %s attempted but no journal exists after " + "running tune2fs.\n" % (devicePath)) if message: rc = message(_("Error"), _("An error occurred migrating %s to ext3. It is " @@ -741,7 +744,7 @@ class swapFileSystem(FileSystemType): # are of format 0 (#122101) if buf is not None and len(buf) == pagesize: if buf[pagesize - 10:] == "SWAP-SPACE": - log("SWAP is of format 0, skipping it") + log.warning("SWAP is of format 0, skipping it") return isys.swapon (device) @@ -932,15 +935,15 @@ class prepbootFileSystem(FileSystemType): devicePath = entry.device.setupDevice(chroot) (disk, part) = getDiskPart(devicePath) if disk is None or part is None: - log("oops, somehow got a bogus device for the PReP partition " - "(%s)" %(devicePath,)) + log.error("oops, somehow got a bogus device for the PReP partition " + "(%s)" %(devicePath,)) return args = [ "sfdisk", "--change-id", disk, "%d" %(part,), "41" ] if disk.startswith("/tmp/") and not os.access(disk, os.R_OK): isys.makeDevInode(disk[5:], disk) - log("going to run %s" %(args,)) + log.info("going to run %s" %(args,)) rc = iutil.execWithRedirect("/usr/sbin/sfdisk", args, stdout = "/dev/tty5", stderr = "/dev/tty5") if rc: @@ -1088,11 +1091,11 @@ class FileSystemSet: and existing.mountpoint == entry.mountpoint): self.remove(existing) # XXX debuggin' -## log ("fsset at %s\n" -## "adding entry for %s\n" -## "entry object %s, class __dict__ is %s", -## self, entry.mountpoint, entry, -## isys.printObject(entry.__dict__)) +## log.info ("fsset at %s\n" +## "adding entry for %s\n" +## "entry object %s, class __dict__ is %s", +## self, entry.mountpoint, entry, +## isys.printObject(entry.__dict__)) self.entries.append(entry) self.entries.sort (mountCompare) @@ -1292,7 +1295,7 @@ MAILADDR root bootDev = self.getBootDev() if bootDev is None: - log("no boot device set") + log.warning("no boot device set") return ret if bootDev.getName() == "RAIDDevice": @@ -1456,7 +1459,7 @@ MAILADDR root entry.fsystem.labelDevice(entry, chroot) def formatEntry(self, entry, chroot): - log("formatting %s as %s" %(entry.mountpoint, entry.fsystem.name)) + log.info("formatting %s as %s" %(entry.mountpoint, entry.fsystem.name)) entry.fsystem.clobberDevice(entry, chroot) entry.fsystem.formatDevice(entry, self.progressWindow, chroot) @@ -1486,7 +1489,7 @@ MAILADDR root try: self.badblocksEntry(entry, chroot) except BadBlocksError: - log("Bad blocks detected on device %s",entry.device.getDevice()) + log.error("Bad blocks detected on device %s",entry.device.getDevice()) if self.messageWindow: self.messageWindow(_("Error"), _("Bad blocks have been detected on " @@ -1600,7 +1603,7 @@ MAILADDR root if not entry.fsystem.isMountable(): continue try: - log("trying to mount %s on %s" %(entry.device.getDevice(), entry.mountpoint)) + log.info("trying to mount %s on %s" %(entry.device.getDevice(), entry.mountpoint)) entry.mount(instPath, readOnly = readOnly) self.mountcount = self.mountcount + 1 except OSError, (num, msg): @@ -1700,7 +1703,7 @@ MAILADDR root try: space.append((entry.mountpoint, isys.fsSpaceAvailable(path))) except SystemError: - log("failed to get space available in filesystemSpace() for %s" %(entry.mountpoint,)) + log.error("failed to get space available in filesystemSpace() for %s" %(entry.mountpoint,)) def spaceSort(a, b): (m1, s1) = a @@ -1727,10 +1730,10 @@ MAILADDR root try: if isys.ext2IsDirty(entry.device.getDevice()): - log("%s is a dirty ext2 partition" % entry.device.getDevice()) + log.info("%s is a dirty ext2 partition" % entry.device.getDevice()) ret.append(entry.device.getDevice()) except Exception, e: - log("got an exception checking %s for being dirty, hoping it's not" %(entry.device.getDevice(),)) + log.error("got an exception checking %s for being dirty, hoping it's not" %(entry.device.getDevice(),)) return ret @@ -1738,9 +1741,9 @@ MAILADDR root # XXX remove special case try: isys.umount(instPath + '/proc/bus/usb', removeDir = 0) - log("Umount USB OK") + log.info("Umount USB OK") except: -# log("Umount USB Fail") +# log.error("Umount USB Fail") pass # take a slice so we don't modify self.entries @@ -2045,7 +2048,7 @@ class RAIDDevice(Device): args.append("--spare-devices=%s" %(self.spares,),) args.extend(map(devify, self.members)) - log("going to run: %s" %(args,)) + log.info("going to run: %s" %(args,)) iutil.execWithRedirect (args[0], args, stderr="/dev/tty5", stdout="/dev/tty5") raid.register_raid_device(self.device, self.members[:], @@ -2323,9 +2326,8 @@ def readFstab (path, intf = None): custom_buttons=[_("_Reboot")]) sys.exit(0) else: - log("WARNING!!! Duplicate labels for %s, but no intf so trying " - "to continue" %(label,)) - + log.warning("Duplicate labels for %s, but no intf so trying " + "to continue" %(label,)) # mark these labels found on the system as used so the factory # doesn't give them to another device @@ -2389,8 +2391,8 @@ def readFstab (path, intf = None): if labelToDevice.has_key(label): device = makeDevice(labelToDevice[label]) else: - log ("Warning: fstab file has LABEL=%s, but this label " - "could not be found on any file system", label) + log.warning ("fstab file has LABEL=%s, but this label " + "could not be found on any file system", label) # bad luck, skip this entry. continue elif fields[2] == "swap" and not fields[0].startswith('/dev/'): @@ -2589,7 +2591,7 @@ def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint): os.close(p[1]) os.close(fd) os.execv(argList[0], argList) - log("failed to exec %s", argList) + log.critical("failed to exec %s", argList) os._exit(1) os.close(p[1]) @@ -2642,7 +2644,7 @@ def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint): try: (pid, status) = os.waitpid(childpid, 0) except OSError, (num, msg): - log("exception from waitpid while formatting: %s %s" %(num, msg)) + log.critical("exception from waitpid while formatting: %s %s" %(num, msg)) status = None os.close(fd) @@ -2658,8 +2660,6 @@ def ext2FormatFilesystem(argList, messageFile, windowCreator, mntpoint): return 1 if __name__ == "__main__": - log.open("foo") - fsset = readFstab("fstab") print fsset.fstab() diff --git a/harddrive.py b/harddrive.py index 78e4ec5a1..23e47e430 100644 --- a/harddrive.py +++ b/harddrive.py @@ -23,9 +23,11 @@ import iutil import rpm import string from rhpl.translate import _, cat, N_ -from rhpl.log import log from constants import * +import logging +log = logging.getLogger("anaconda") + FILENAME = 1000000 # Install from one or more iso images @@ -134,8 +136,8 @@ class HardDriveInstallMethod(InstallMethod): # will mount the appropriate ISO image as required by CD # in header def getRPMFilename(self, h, timer, callback=None): if self.mediaIsMounted != h[1000002]: - log("switching from iso %s to %s" %(self.mediaIsMounted, - h[1000002])) + log.info("switching from iso %s to %s" %(self.mediaIsMounted, + h[1000002])) self.umountMedia() self.mountMedia(h[1000002]) @@ -188,7 +190,7 @@ class HardDriveInstallMethod(InstallMethod): try: self.umountMedia() except: - log("unable to unmount media") + log.error("unable to unmount media") # we cannot remove the partition we are hosting hard drive install from def protectedPartitions(self): diff --git a/hdrlist.py b/hdrlist.py index 569dcd635..3a8154dc1 100644 --- a/hdrlist.py +++ b/hdrlist.py @@ -586,7 +586,7 @@ class Group: if p in checked or p in tocheck or p in pkgs: continue if p is None: -# log("ERROR: unable to resolve dep %s" %(dep,)) +# log.error("unable to resolve dep %s" %(dep,)) continue self.grpset.hdrlist[p].select() @@ -26,9 +26,11 @@ import product from constants import * -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + # this sucks, but we want to consider s390x as s390x in here but generally # don't. *sigh* if os.uname()[4] == "s390x": @@ -66,13 +68,13 @@ def presentRequiredMediaMessage(intf, grpset): discNums = getDiscNums(f.readline().strip()) f.close() except Exception, e: - log("Exception reading discinfo: %s" %(e,)) + log.critical("Exception reading discinfo: %s" %(e,)) - log("discNums is %s" %(discNums,)) + log.info("discNums is %s" %(discNums,)) haveall = 1 for cd in reqcds: if cd not in discNums: - log("don't have %s" %(cd,)) + log.error("don't have %s" %(cd,)) haveall = 0 break @@ -110,7 +112,7 @@ class ImageInstallMethod(InstallMethod): def getRPMFilename(self, h, timer, callback=None): if self.currentIso is not None and self.currentIso != h[1000002]: - log("switching from iso %s to %s for %s-%s-%s.%s" %(self.currentIso, h[1000002], h['name'], h['version'], h['release'], h['arch'])) + log.info("switching from iso %s to %s for %s-%s-%s.%s" %(self.currentIso, h[1000002], h['name'], h['version'], h['release'], h['arch'])) self.currentIso = h[1000002] return self.getFilename("/%s/RPMS/%s" % (productPath, h[1000000]), callback=callback) def readHeaders(self): @@ -150,7 +152,7 @@ class CdromInstallMethod(ImageInstallMethod): self.currentDisc = [] break except Exception, e: - log("exception in unmountCD: %s" %(e,)) + log.error("exception in unmountCD: %s" %(e,)) self.messageWindow(_("Error"), _("An error occurred unmounting the CD. " "Please make sure you're not accessing " @@ -159,7 +161,7 @@ class CdromInstallMethod(ImageInstallMethod): % ("/mnt/source",)) def ejectCD(self): - log("ejecting CD") + log.info("ejecting CD") # make /tmp/cdrom again so cd gets ejected isys.makeDevInode(self.device, "/tmp/cdrom") @@ -167,7 +169,7 @@ class CdromInstallMethod(ImageInstallMethod): try: isys.ejectCdrom("/tmp/cdrom", makeDevice = 0) except Exception, e: - log("eject failed %s" % (e,)) + log.error("eject failed %s" % (e,)) pass def systemUnmounted(self): @@ -188,7 +190,7 @@ class CdromInstallMethod(ImageInstallMethod): (self.progressWindow, _("Copying File"), _("Transferring install image to hard drive..."))) except Exception, e: - log("error transferring stage2.img: %s" %(e,)) + log.critical("error transferring stage2.img: %s" %(e,)) self.messageWindow(_("Error"), _("An error occurred transferring the install image " "to your hard drive. You are probably out of disk " @@ -204,11 +206,11 @@ class CdromInstallMethod(ImageInstallMethod): def getRPMFilename(self, h, timer, callback=None): if h[1000002] == None or 1000002 not in h.keys(): - log ("header for %s has no disc location tag, assuming it's" - "on the current CD" %(h[1000000],)) + log.warning("header for %s has no disc location tag, assuming it's" + "on the current CD" %(h[1000000],)) elif h[1000002] not in self.currentDisc: timer.stop() - log("switching from iso %s to %s for %s-%s-%s.%s" %(self.currentDisc, h[1000002], h['name'], h['version'], h['release'], h['arch'])) + log.info("switching from iso %s to %s for %s-%s-%s.%s" %(self.currentDisc, h[1000002], h['name'], h['version'], h['release'], h['arch'])) if os.access("/mnt/source/.discinfo", os.R_OK): f = open("/mnt/source/.discinfo") @@ -349,8 +351,8 @@ class CdromInstallMethod(ImageInstallMethod): h[1000000]), tmppath + h[1000000]) except IOError, (errnum, msg): - log("IOError %s occurred copying %s: %s", - errnum, h[1000000], str(msg)) + log.critical("IOError %s occurred copying %s: %s", + errnum, h[1000000], str(msg)) time.sleep(5) else: break @@ -370,7 +372,7 @@ class CdromInstallMethod(ImageInstallMethod): try: isys.umount("/mnt/source") except Exception, e: - log("unable to unmount source in filesDone: %s" %(e,)) + log.error("unable to unmount source in filesDone: %s" %(e,)) if not self.loopbackFile: return @@ -461,13 +463,13 @@ def findIsoImages(path, messageWindow): if (num == 1 and not os.access("/mnt/cdimage/%s/base/stage2.img" % (productPath,), os.R_OK)): - log("%s doesn't have a stage2.img, skipping" %(what,)) + log.warning("%s doesn't have a stage2.img, skipping" %(what,)) continue # we only install binary packages and they have to be # in the product/RPMS/ dir. make sure it exists to # avoid overwriting discs[2] with disc2 of the src.rpm set if not os.path.isdir("/mnt/cdimage/%s/RPMS" %(productPath,)): - log("%s doesn't have binary RPMS, skipping" %(what,)) + log.warning("%s doesn't have binary RPMS, skipping" %(what,)) continue # warn user if images appears to be wrong size @@ -504,7 +506,7 @@ class NfsIsoInstallMethod(NfsInstallMethod): def getRPMFilename(self, h, timer, callback=None): if self.imageMounted != h[1000002]: - log("switching from iso %s to %s for %s-%s-%s.%s" %(self.imageMounted, h[1000002], h['name'], h['version'], h['release'], h['arch'])) + log.info("switching from iso %s to %s for %s-%s-%s.%s" %(self.imageMounted, h[1000002], h['name'], h['version'], h['release'], h['arch'])) self.umountImage() self.mountImage(h[1000002]) @@ -566,7 +568,7 @@ class NfsIsoInstallMethod(NfsInstallMethod): try: self.umountImage() except Exception, e: - log("unable to unmount image in filesDone: %s" %(e,)) + log.error("unable to unmount image in filesDone: %s" %(e,)) pass def __init__(self, tree, rootPath, intf): diff --git a/installclass.py b/installclass.py index 5d56a645b..e27e962ac 100644 --- a/installclass.py +++ b/installclass.py @@ -22,9 +22,11 @@ from instdata import InstallData from partitioning import * from autopart import getAutopartitionBoot, autoCreatePartitionRequests, autoCreateLVMPartitionRequests -from rhpl.log import log from rhpl.translate import _, N_ +import logging +log = logging.getLogger("anaconda") + from constants import BETANAG class BaseInstallClass: @@ -88,8 +90,8 @@ class BaseInstallClass: if drive in id.bootloader.drivelist: new.append(drive) else: - log("requested drive %s in boot drive order doesn't " - "exist" %(drive,)) + log.warning("requested drive %s in boot drive order " + "doesn't exist" %(drive,)) id.bootloader.drivelist = new def setIgnoredDisks(self, id, drives): @@ -374,25 +376,25 @@ class BaseInstallClass: if depth: availableDepths = id.xsetup.xhwstate.available_color_depths() if depth not in availableDepths: - log("Requested depth %s not available, falling back to %s" - %(depth, availableDepths[-1])) + log.warning("Requested depth %s not available, falling back " + "to %s" %(depth, availableDepths[-1])) depth = availableDepths[-1] id.xsetup.xhwstate.set_colordepth(depth) if resolution: availableRes = id.xsetup.xhwstate.available_resolutions() if resolution not in availableRes: - log("Requested resolution %s is not supported, falling " - "back to %s. To avoid this you may need to specify the " - "videocard and monitor specs on the xconfig ks " - "directive if they were not probed correctly." - %(resolution, availableRes[-1])) + log.warning("Requested resolution %s is not supported, " + "falling back to %s. To avoid this you may need " + "to specify the videocard and monitor specs on " + "the xconfig ks directive if they were not probed " + "correctly." %(resolution, availableRes[-1])) resolution = availableRes[-1] id.xsetup.xhwstate.set_resolution(resolution) if not resolution and not depth: # choose a sane default - log("resolution and depth not specified, trying to be sane") + log.warning("resolution and depth not specified, trying to be sane") id.xsetup.xhwstate.choose_sane_default() if desktop is not None: @@ -426,7 +428,7 @@ class BaseInstallClass: id.monitor.setSpecs(hsync, vsync, id=useid, name=model) setmonitor = 1 except: - log("Couldnt lookup monitor type %s." % usemon) + log.warning("Couldnt lookup monitor type %s." % usemon) pass else: monname = "Unprobed Monitor" @@ -437,8 +439,8 @@ class BaseInstallClass: if not setmonitor: # fall back to standard VGA - log("Could not probe monitor, and no fallback specified.") - log("Falling back to Generic VGA monitor") + log.warning("Could not probe monitor, and no fallback specified.") + log.warning("Falling back to Generic VGA monitor") try: hsync = "31.5-37.9" @@ -482,7 +484,7 @@ class BaseInstallClass: id.xsetup.xhwstate.set_videocard_ram(int(videoRam)) if server is not None: - log("unable to really do anything with server right now") + log.error("unable to really do anything with server right now") def configureX(self, id, server = None, card = None, videoRam = None, monitorName = None, hsync = None, vsync = None, resolution = None, depth = None, noProbe = 0, startX = 0): diff --git a/installmethod.py b/installmethod.py index f2b153598..a02df6c1a 100644 --- a/installmethod.py +++ b/installmethod.py @@ -16,7 +16,8 @@ import string from hdrlist import groupSetFromCompsFile from constants import * -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") class FileCopyException(Exception): def __init__(self, s = ""): @@ -37,10 +38,10 @@ class InstallMethod: for pre in tryloc: tmpname = pre + "/" + file if os.access(tmpname, os.R_OK): - log("Using file://%s", tmpname) + log.info("Using file://%s", tmpname) return "file://%s" %(tmpname,) - log("Unable to find %s", file) + log.error("Unable to find %s", file) return None def protectedPartitions(self): @@ -76,7 +77,7 @@ class InstallMethod: break if tmppath is None: - log("Unable to find temp path, going to use ramfs path") + log.warning("Unable to find temp path, going to use ramfs path") return "/tmp/" return tmppath @@ -15,9 +15,11 @@ import types, os, sys, isys, select, string, stat, signal import os.path -from rhpl.log import log from flags import flags +import logging +log = logging.getLogger("anaconda") + def getArch (): arch = os.uname ()[4] if (len (arch) == 4 and arch[0] == 'i' and @@ -249,7 +251,7 @@ def swapSuggestion(quiet=0): mem = memInstalled()/1024 mem = ((mem/16)+1)*16 if not quiet: - log("Detected %sM of memory", mem) + log.info("Detected %sM of memory", mem) if mem < 128: minswap = 96 @@ -263,7 +265,7 @@ def swapSuggestion(quiet=0): maxswap = 2*mem if not quiet: - log("Swap attempt of %sM to %sM", minswap, maxswap) + log.info("Swap attempt of %sM to %sM", minswap, maxswap) return (minswap, maxswap) @@ -393,7 +395,7 @@ esac stdout = None, stderr = None, root = root) except RuntimeError: - log("Failed to set clock properly. Going to try to continue anyway.") + log.error("Failed to set clock properly. Going to try to continue anyway.") def swapAmount(): f = open("/proc/meminfo", "r") @@ -518,7 +520,7 @@ def isUSBDevFSMounted(): if string.find(l, "usbdevfs") != -1: return 1 except: - log("In isUSBMounted, failed to open /proc/mounts") + log.error("In isUSBMounted, failed to open /proc/mounts") return 0 return 0 @@ -570,14 +572,14 @@ def getPPCMachine(): break if machine is None: - log("Unable to find PowerPC machine type") + log.warning("Unable to find PowerPC machine type") return for type in ppcType.items(): if machine.find(type[0]) != -1: return type[1] - log("Unknown PowerPC machine type: %s" %(machine,)) + log.warning("Unknown PowerPC machine type: %s" %(machine,)) return 0 # return the pmac machine id @@ -598,7 +600,7 @@ def getPPCMacID(): machine = machine.strip() return machine - log("WARNING: No Power Mac machine id") + log.warning("No Power Mac machine id") return 0 # return the pmac generation @@ -621,13 +623,13 @@ def getPPCMacGen(): break if gen is None: - log("Unable to find pmac-generation") + log.warning("Unable to find pmac-generation") for type in pmacGen: if gen.find(type) != -1: return type - log("Unknown Power Mac generation: %s" %(gen,)) + log.warning("Unknown Power Mac generation: %s" %(gen,)) return 0 # return if pmac machine is it an iBook/PowerBook diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py index 8ea593143..649a54f0b 100644 --- a/iw/lvm_dialog_gui.py +++ b/iw/lvm_dialog_gui.py @@ -28,6 +28,8 @@ from partition_ui_helpers_gui import * from constants import * import lvm +import logging +log = logging.getLogger("anaconda") class VolumeGroupEditor: @@ -788,7 +790,7 @@ class VolumeGroupEditor: # have to clamp pvsize to multiple of PE availSpaceMB = availSpaceMB + pvsize - log("computeVGSize: vgsize is %s" % (availSpaceMB,)) + log.info("computeVGSize: vgsize is %s" % (availSpaceMB,)) return availSpaceMB def computeLVSpaceNeeded(self, logreqs): diff --git a/iw/package_gui.py b/iw/package_gui.py index 2ff69de11..2de4e6ee7 100644 --- a/iw/package_gui.py +++ b/iw/package_gui.py @@ -33,9 +33,10 @@ from hdrlist import PKGTYPE_MANDATORY, PKGTYPE_DEFAULT, PKGTYPE_OPTIONAL from hdrlist import ON, MANUAL_ON, OFF, MANUAL_OFF, MANUAL_NONE from hdrlist import ON_STATES, OFF_STATES from hdrlist import Package, Group -from rhpl.log import log import packages +import logging +log = logging.getLogger("anaconda") def queryUpgradeContinue(intf): rc = intf.messageWindow(_("Proceed with upgrade?"), @@ -615,12 +616,12 @@ class PackageSelectionWindow (InstallWindow): if sel not in ON_STATES: comp.selectPackage(pkg) else: - log("%s already selected, not selecting!" %(pkg,)) + log.warning("%s already selected, not selecting!" %(pkg,)) else: if sel in ON_STATES: comp.unselectPackage(pkg) else: - log("%s already unselected, not unselecting!" %(pkg,)) + log.warning("%s already unselected, not unselecting!" %(pkg,)) if sizeLabel: self.setDetailSizeLabel(comp, sizeLabel) diff --git a/iw/partition_gui.py b/iw/partition_gui.py index 2341bcb8b..5c3af3600 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -47,6 +47,9 @@ from partRequests import * from constants import * from partition_ui_helpers_gui import * +import logging +log = logging.getLogger("anaconda") + STRIPE_HEIGHT = 35.0 LOGICAL_INSET = 3.0 CANVAS_WIDTH_800 = 490 @@ -990,7 +993,7 @@ class PartitionWindow(InstallWindow): if request.uniqueID in origInfoDict.keys(): (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID] except: - log("Failed to restore original info") + log.error("Failed to restore original info") self.intf.messageWindow(_("Error Partitioning"), _("Could not allocate requested partitions: %s.") % (msg), diff --git a/iw/progress_gui.py b/iw/progress_gui.py index 73a9b83e7..4de61ec22 100644 --- a/iw/progress_gui.py +++ b/iw/progress_gui.py @@ -28,9 +28,11 @@ from iw_gui import * from rhpl.translate import _, N_ from packages import doInstall from constants import * -from rhpl.log import log from gui import processEvents, takeScreenShot +import logging +log = logging.getLogger("anaconda") + # FIXME: from redhat-config-packages. perhaps move to common location def size_string (size): def number_format(s): @@ -156,9 +158,9 @@ class InstallProgressWindow_NEW (InstallWindow): if self.numComplete > 100: if self.initialTimeEstimate is None: self.initialTimeEstimate = timeest - log("Initial install time estimate = %s", timeest) + log.info("Initial install time estimate = %s", timeest) -# log ("elapsed time, time est, remaining time = %s %s", int(elapsedTime/60), timeest) +# log.info("elapsed time, time est, remaining time = %s %s", int(elapsedTime/60), timeest) if timeest < 10: timefactor = 2 @@ -168,7 +170,7 @@ class InstallProgressWindow_NEW (InstallWindow): self.remainingTimeLabel.set_text(str) if (fractionComplete >= 1): - log("Actual install time = %s", elapsedTime/60.0) + log.info("Actual install time = %s", elapsedTime/60.0) self.remainingTimeLabel.set_text("") self.totalProgress.set_fraction(fractionComplete) @@ -206,7 +208,7 @@ class InstallProgressWindow_NEW (InstallWindow): self.adbox.add (pix) self.adpix = pix else: - log("couldn't get a pix") + log.warning("couldn't get a pix") self.adbox.show_all() self.pixcurnum = num + 1 diff --git a/iw/upgrade_migratefs_gui.py b/iw/upgrade_migratefs_gui.py index d63750261..41b60378e 100644 --- a/iw/upgrade_migratefs_gui.py +++ b/iw/upgrade_migratefs_gui.py @@ -24,8 +24,6 @@ from fsset import * import gui import gtk -from rhpl.log import log - class UpgradeMigrateFSWindow (InstallWindow): windowTitle = N_("Migrate File Systems") htmlTag = "upmigfs" diff --git a/iw/upgrade_swap_gui.py b/iw/upgrade_swap_gui.py index e371d4ef8..09cf813e4 100644 --- a/iw/upgrade_swap_gui.py +++ b/iw/upgrade_swap_gui.py @@ -24,7 +24,6 @@ from iw_gui import * from package_gui import queryUpgradeContinue from flags import flags -from rhpl.log import log from rhpl.translate import _, N_ class UpgradeSwapWindow (InstallWindow): diff --git a/iw/xconfig_gui.py b/iw/xconfig_gui.py index 063b52ee2..85b80d5ad 100644 --- a/iw/xconfig_gui.py +++ b/iw/xconfig_gui.py @@ -24,10 +24,12 @@ import gtk from iw_gui import * from constants import * -from rhpl.log import log from rhpl.translate import _, N_ from rhpl.monitor import isValidSyncRange +import logging +log = logging.getLogger("anaconda") + from desktop import ENABLE_DESKTOP_CHOICE from gui import setupTreeViewFixupIdleHandler @@ -83,7 +85,7 @@ class XCustomWindow (InstallWindow): def testPressed (self, widget, *args): - log("Somehow X test was attempted") + log.warning("Somehow X test was attempted") return def numCompare (self, first, second): @@ -183,7 +185,7 @@ class XCustomWindow (InstallWindow): try: self.load_monitor_preview_pixmap(self.monitor_pixmaps[num]) except: - log("Unable to load monitor preview #%s", num) + log.warning("Unable to load monitor preview #%s", num) def display_desktop_pixmap(self, desktop): self.vbox4.destroy () @@ -863,7 +865,7 @@ class XConfigWindow (InstallWindow): self.xsetup.xhwstate.set_videocard_name(cardname) self.xsetup.xhwstate.set_videocard_card(cardname) except: - log("videocard-getNext: could not determine cardname for primary card %s", self.videocard.primaryCard()) + log.error("videocard-getNext: could not determine cardname for primary card %s", self.videocard.primaryCard()) return None def skipToggled (self, widget, *args): diff --git a/network.py b/network.py index 6dd5cd0fd..0bc62f683 100644 --- a/network.py +++ b/network.py @@ -24,10 +24,12 @@ import os import re import kudzu -from rhpl.log import log from rhpl.translate import _, N_ from rhpl.simpleconfig import SimpleConfigFile +import logging +log = logging.getLogger("anaconda") + def inStrRange(v, s): if string.find(s, v) == -1: return 0 @@ -272,7 +274,7 @@ class Network: hwaddr and hwaddr != "00:00:00:00:00:00"): self.netdevices[dev].set(("hwaddr", hwaddr)) except Exception, e: - log("exception getting mac addr: %s" %(e,)) + log.error("exception getting mac addr: %s" %(e,)) if ksdevice and self.netdevices.has_key(ksdevice): self.firstnetdevice = ksdevice @@ -321,11 +323,11 @@ class Network: self.isConfigured = 1 break except SystemError: - log("failed to configure network device %s when " - "looking up host name", dev.get('device')) + log.error("failed to configure network device %s when " + "looking up host name", dev.get('device')) if not self.isConfigured: - log("no network devices were available to look up host name") + log.warning("no network devices were available to look up host name") return None f = open("/etc/resolv.conf", "w") @@ -446,7 +448,7 @@ class Network: f = open(instPath + "/etc/hosts", "w") localline = "127.0.0.1\t\t" - log("self.hostname = %s", self.hostname) + log.info("self.hostname = %s", self.hostname) ip = self.lookupHostname() diff --git a/partRequests.py b/partRequests.py index b0cd01bc5..cd15686f5 100644 --- a/partRequests.py +++ b/partRequests.py @@ -24,7 +24,6 @@ import os, sys, math from constants import * from rhpl.translate import _ -from rhpl.log import log import fsset import raid @@ -32,6 +31,9 @@ import lvm import partedUtils import partIntfHelpers +import logging +log = logging.getLogger("anaconda") + class DeleteSpec: """Defines a preexisting partition which is intended to be removed.""" @@ -750,7 +752,7 @@ class VolumeGroupRequestSpec(RequestSpec): """Return a device which can be solidified.""" if self.dev: # FIXME: this warning can probably be removed post-beta - log("WARNING: getting self.dev more than once for %s" %(self,)) + log.warning("getting self.dev more than once for %s" %(self,)) return self.dev pvs = [] @@ -776,9 +778,9 @@ class VolumeGroupRequestSpec(RequestSpec): for pvid in self.physicalVolumes: pvreq = partitions.getRequestByID(pvid) size = pvreq.getActualSize(partitions, diskset) - #log("size for pv %s is %s" % (pvid, size)) + #log.info("size for pv %s is %s" % (pvid, size)) size = lvm.clampPVSize(size, self.pesize) - (self.pesize/1024) - #log(" clamped size is %s" % (size,)) + #log.info(" clamped size is %s" % (size,)) totalspace = totalspace + size return totalspace diff --git a/partedUtils.py b/partedUtils.py index ccf26d055..e905cc553 100644 --- a/partedUtils.py +++ b/partedUtils.py @@ -29,9 +29,11 @@ import lvm from flags import flags from partErrors import * -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + fsTypes = {} fs_type = parted.file_system_type_get_next () @@ -283,7 +285,7 @@ def checkDasdFmt(disk, intf): devs = isys.getDasdDevPort() dev = "/dev/%s (%s)" %(disk.dev.path[5:], devs[device]) except Exception, e: - log("exception getting dasd dev ports: %s" %(e,)) + log.critical("exception getting dasd dev ports: %s" %(e,)) dev = "/dev/%s" %(disk.dev.path[5:],) rc = intf.messageWindow(_("Warning"), @@ -409,7 +411,7 @@ def sniffFilesystemType(device): if len(buf) < pagesize: try: - log("Tried to read pagesize for %s in sniffFilesystemType and only read %s", dev, len(buf)) + log.error("Tried to read pagesize for %s in sniffFilesystemType and only read %s", dev, len(buf)) except: pass return None @@ -774,7 +776,7 @@ class DiskSet: os.close(p[1]) os.close(fd) os.execv(argList[0], argList) - log("failed to exec %s", argList) + log.critical("failed to exec %s", argList) os._exit(1) os.close(p[1]) @@ -886,8 +888,8 @@ class DiskSet: except parted.error, msg: recreate = 0 if zeroMbr: - log("zeroMBR was set and invalid partition table found " - "on %s" % (dev.path[5:])) + log.error("zeroMBR was set and invalid partition table " + "found on %s" % (dev.path[5:])) recreate = 1 elif not intf: DiskSet.skippedDisks.append(drive) diff --git a/partitioning.py b/partitioning.py index b0ca08e1a..bdcdb484c 100644 --- a/partitioning.py +++ b/partitioning.py @@ -36,8 +36,6 @@ from partErrors import * import partRequests from rhpl.translate import _ -from rhpl.log import log - def partitionObjectsInitialize(diskset, partitions, dir, intf): if dir == DISPATCH_BACK: diff --git a/partitions.py b/partitions.py index bfd3123dd..e98581b1c 100644 --- a/partitions.py +++ b/partitions.py @@ -32,7 +32,9 @@ import partedUtils import partRequests from rhpl.translate import _ -from rhpl.log import log + +import logging +log = logging.getLogger("anaconda") class Partitions: """Defines all of the partition requests and delete requests.""" @@ -144,14 +146,14 @@ class Partitions: level = "RAID%s" %(level,) if level not in raid.availRaidLevels: - log("raid level %s not supported, skipping %s" %(level, + log.warning("raid level %s not supported, skipping %s" %(level, theDev)) continue try: chunk = isys.getRaidChunkFromDevice("/dev/%s" %(theDev,)) except Exception, e: - log("couldn't get chunksize of %s: %s" %(theDev, e)) + log.error("couldn't get chunksize of %s: %s" %(theDev, e)) chunk = None # is minor always mdN ? @@ -160,8 +162,8 @@ class Partitions: for dev in devices: req = self.getRequestByDeviceName(dev) if not req: - log("RAID device %s using non-existent partition %s" - %(theDev, dev)) + log.error("RAID device %s using non-existent partition %s" + %(theDev, dev)) continue raidvols.append(req.uniqueID) @@ -196,7 +198,7 @@ class Partitions: try: preexist_size = float(size) except: - log("preexisting size for %s not a valid integer, ignoring" %(vg,)) + log.error("preexisting size for %s not a valid integer, ignoring" %(vg,)) preexist_size = None pvids = [] @@ -205,8 +207,8 @@ class Partitions: continue req = self.getRequestByDeviceName(dev[5:]) if not req: - log("Volume group %s using non-existent partition %s" - %(vg, dev)) + log.error("Volume group %s using non-existent partition %s" + %(vg, dev)) continue pvids.append(req.uniqueID) spec = partRequests.VolumeGroupRequestSpec(format = 0, @@ -951,12 +953,12 @@ class Partitions: protected = dispatch.method.protectedPartitions() if protected: for device in protected: - log("%s is a protected partition" % (device)) + log.info("%s is a protected partition" % (device)) request = self.getRequestByDeviceName(device) if request is not None: request.setProtected(1) else: - log("no request, probably a removable drive") + log.info("no request, probably a removable drive") def copy (self): """Deep copy the object.""" @@ -1267,7 +1269,7 @@ class Partitions: delete.setDeleted(1) for name,vg in lvm_parent_deletes: - log("removing lv %s" % (name,)) + log.info("removing lv %s" % (name,)) lvm.lvremove(name, vg) # now, go through and delete volume groups @@ -1309,8 +1311,8 @@ class Partitions: toRemove.append(req) tmp = self.getRequestByID(req.volumeGroup) if not tmp: - log("Unable to find the vg for %s" - % (req.logicalVolumeName,)) + log.error("Unable to find the vg for %s" + % (req.logicalVolumeName,)) vgname = req.volumeGroup else: vgname = tmp.volumeGroupName @@ -14,22 +14,24 @@ # import iutil, string, os, kudzu -from rhpl.log import log + +import logging +log = logging.getLogger("anaconda") def pcicType(test = 0): devs = kudzu.probe(kudzu.CLASS_SOCKET, kudzu.BUS_PCI, 0) if devs: - log("Found a pcic controller of type: yenta_socket") + log.info("Found a pcic controller of type: yenta_socket") return "yenta_socket" # lets look for non-PCI socket controllers now devs = kudzu.probe(kudzu.CLASS_SOCKET, kudzu.BUS_MISC, 0) if devs and devs[0].driver not in ["ignore", "unknown", "disabled"]: - log("Found a pcic controller of type: %s", devs[0].driver) + log.info("Found a pcic controller of type: %s", devs[0].driver) return devs[0].driver - log("No pcic controller detected") + log.info("No pcic controller detected") return None def createPcmciaConfig(path, test = 0): @@ -43,7 +43,8 @@ import os import partitioning import partedUtils -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") # these arches can have their /boot on RAID and not have their # boot loader blow up @@ -79,7 +80,7 @@ def scanForRaid(drives): isys.raidsb(dev) except ValueError: # bad magic, this can't be part of our raid set - log("reading raid sb failed for %s",dev) + log.error("reading raid sb failed for %s",dev) continue if raidSets.has_key(raidSet): @@ -88,10 +89,10 @@ def scanForRaid(drives): if knownLevel != level or knownDisks != totalDisks or \ knownMinor != mdMinor: # Raise hell - log("raid set inconsistency for md%d: " - "all drives in this raid set do not " - "agree on raid parameters. Skipping raid device", - mdMinor) + log.error("raid set inconsistency for md%d: " + "all drives in this raid set do not " + "agree on raid parameters. Skipping raid device", + mdMinor) continue knownDevices.append(dev) raidSets[raidSet] = (knownLevel, knownDisks, knownMinor, @@ -101,10 +102,10 @@ def scanForRaid(drives): if raidDevices.has_key(mdMinor): if (raidDevices[mdMinor] != raidSet): - log("raid set inconsistency for md%d: " - "found members of multiple raid sets " - "that claim to be md%d. Using only the first " - "array found.", mdMinor, mdMinor) + log.error("raid set inconsistency for md%d: " + "found members of multiple raid sets " + "that claim to be md%d. Using only the first " + "array found.", mdMinor, mdMinor) continue else: raidDevices[mdMinor] = raidSet @@ -113,10 +114,10 @@ def scanForRaid(drives): for key in raidSets.keys(): (level, totalDisks, mdMinor, devices) = raidSets[key] if len(devices) < totalDisks: - log("missing components of raid device md%d. The " - "raid device needs %d drive(s) and only %d (was/were) found. " - "This raid device will not be started.", mdMinor, - totalDisks, len(devices)) + log.warning("missing components of raid device md%d. The " + "raid device needs %d drive(s) and only %d (was/were) " + "found. This raid device will not be started.", mdMinor, + totalDisks, len(devices)) continue raidList.append((mdMinor, devices, level, totalDisks)) @@ -25,9 +25,11 @@ import iutil import fsset import shutil -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + class RescueInterface: def waitWindow(self, title, text): return WaitWindow(self.screen, title, text) @@ -113,7 +115,7 @@ def startNetworking(network, intf): try: os.system("/usr/bin/ifconfig lo 127.0.0.1") except: - log("Error trying to start lo in rescue.py::startNetworking()") + log.error("Error trying to start lo in rescue.py::startNetworking()") # start up dhcp interfaces first dhcpGotNS = 0 @@ -123,7 +125,7 @@ def startNetworking(network, intf): dev = network.netdevices[devname] waitwin = intf.waitWindow(_("Starting Interface"), _("Attempting to start %s") % (dev.get('device'),)) - log("Attempting to start %s", dev.get('device')) + log.info("Attempting to start %s", dev.get('device')) if dev.get('bootproto') == "dhcp": try: ns = isys.pumpNetDevice(dev.get('device')) @@ -135,7 +137,7 @@ def startNetworking(network, intf): f.write("nameserver %s\n" % ns) f.close() except: - log("Error trying to start %s in rescue.py::startNetworking()", dev.get('device')) + log.error("Error trying to start %s in rescue.py::startNetworking()", dev.get('device')) elif dev.get('ipaddr') and dev.get('netmask') and network.gateway is not None: try: isys.configNetDevice(dev.get('device'), @@ -143,7 +145,7 @@ def startNetworking(network, intf): dev.get('netmask'), network.gateway) except: - log("Error trying to start %s in rescue.py::startNetworking()", dev.get('device')) + log.error("Error trying to start %s in rescue.py::startNetworking()", dev.get('device')) waitwin.pop() @@ -351,7 +353,7 @@ def runRescue(instPath, mountroot, id): try: fs.turnOnSwap("/") except: - log("Error enabling swap") + log.error("Error enabling swap") # now that dev is udev, bind mount the installer dev there isys.mount("/dev", "/mnt/sysimage/dev", bindMount = 1) @@ -431,7 +433,7 @@ def runRescue(instPath, mountroot, id): try: makeResolvConf(instPath) except Exception, e: - log("error making a resolv.conf: %s" %(e,)) + log.error("error making a resolv.conf: %s" %(e,)) print _("Your system is mounted under the %s directory.") % (instPath,) print diff --git a/security.py b/security.py index 67f77ba65..926bc30ed 100644 --- a/security.py +++ b/security.py @@ -17,7 +17,8 @@ import os, string import iutil from flags import flags -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") SEL_DISABLED = 0 SEL_PERMISSIVE = 1 @@ -36,7 +37,7 @@ class Security: def setSELinux(self, val): if not selinux_states.has_key(val): - log("Tried to set to invalid SELinux state: %s" %(val,)) + log.error("Tried to set to invalid SELinux state: %s" %(val,)) val = SEL_DISABLED self.selinux = val @@ -46,7 +47,7 @@ class Security: def writeKS(self, f): if not selinux_states.has_key(self.selinux): - log("ERROR: unknown selinux state: %s" %(self.selinux,)) + log.error("unknown selinux state: %s" %(self.selinux,)) return f.write("selinux --%s\n" %(selinux_states[self.selinux],)) @@ -55,7 +56,7 @@ class Security: args = [ "/usr/sbin/lokkit", "--quiet", "--nostart" ] if not selinux_states.has_key(self.selinux): - log("ERROR: unknown selinux state: %s" %(self.selinux,)) + log.error("unknown selinux state: %s" %(self.selinux,)) return args = args + [ "--selinux=%s" %(selinux_states[self.selinux],) ] @@ -65,10 +66,10 @@ class Security: iutil.execWithRedirect(args[0], args, root = instPath, stdout = None, stderr = None) else: - log("would have run %s", args) + log.error("would have run %s", args) except RuntimeError, msg: - log ("lokkit run failed: %s", msg) + log.error ("lokkit run failed: %s", msg) except OSError, (errno, msg): - log ("lokkit run failed: %s", msg) + log.error ("lokkit run failed: %s", msg) diff --git a/syslogd.py b/syslogd.py index f484de05a..5d4a01954 100644 --- a/syslogd.py +++ b/syslogd.py @@ -17,7 +17,9 @@ import sys, os import string from socket import * from select import select -from rhpl.log import log + +import logging +log = logging.getLogger("anaconda") class Syslogd: def goSyslog(self, output, sockName): @@ -88,12 +90,12 @@ class InstSyslog: try: os.kill (self.pid, 15) except OSError, (num, msg): - log("killing syslogd failed: %s %s" %(num, msg)) + log.error("killing syslogd failed: %s %s" %(num, msg)) try: os.waitpid (self.pid, 0) except OSError, (num, msg): - log("exception from waitpid in syslogd::stop: %s %s" % (num, msg)) + log.error("exception from waitpid in syslogd::stop: %s %s" % (num, msg)) self.pid = -1 @@ -467,8 +467,8 @@ class InstallInterface: win = nextWindow() - #log("TUI running step %s (class %s, file %s)" % - #(step, file, classNames)) + #log.info("TUI running step %s (class %s, file %s)" % + #(step, file, classNames)) rc = apply(win, (self.screen, ) + args) diff --git a/textw/bootloader_text.py b/textw/bootloader_text.py index cf394cd28..dc3f938be 100644 --- a/textw/bootloader_text.py +++ b/textw/bootloader_text.py @@ -16,11 +16,10 @@ from constants import * from constants_text import * from rhpl.translate import _ from flags import flags -from rhpl.log import log import string import iutil import bootloader - + class BootloaderChoiceWindow: def __call__(self, screen, dispatch, bl, fsset, diskSet): diff --git a/textw/keyboard_text.py b/textw/keyboard_text.py index dd7fa0327..eaad3d262 100644 --- a/textw/keyboard_text.py +++ b/textw/keyboard_text.py @@ -17,9 +17,11 @@ from snack import * from constants_text import * from flags import flags -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + class KeyboardWindow: def __call__(self, screen, defaultByLang, kbd): if flags.serial or flags.virtpconsole: @@ -50,6 +52,6 @@ class KeyboardWindow: try: isys.loadKeymap(keyboards[choice]) except SystemError, (errno, msg): - log("Could not install keymap %s: %s" % (keyboards[choice], msg)) + log.error("Could not install keymap %s: %s" % (keyboards[choice], msg)) return INSTALL_OK diff --git a/textw/language_text.py b/textw/language_text.py index 769ee1a2d..98b711005 100644 --- a/textw/language_text.py +++ b/textw/language_text.py @@ -19,9 +19,11 @@ from snack import * from constants_text import * from flags import flags -from rhpl.log import * from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + class LanguageWindow: def __call__(self, screen, textInterface, instLanguage): languages = instLanguage.available () @@ -59,13 +61,13 @@ class LanguageWindow: and not isys.isVioConsole()): # bterm to the rescue... have to shut down the screen and # create a new one, though (and do a sleep) - log("starting bterm") + log.info("starting bterm") try: screen.finish() rc = isys.startBterm() time.sleep(1) except Exception, e: - log("got an exception starting bterm: %s" %(e,)) + log.error("got an exception starting bterm: %s" %(e,)) rc = 1 newscreen = SnackScreen() textInterface.setScreen(newscreen) diff --git a/textw/network_text.py b/textw/network_text.py index 33a6acfc7..f39d237e2 100644 --- a/textw/network_text.py +++ b/textw/network_text.py @@ -23,8 +23,6 @@ from network import sanityCheckHostname from snack import * from constants_text import * from rhpl.translate import _ -from rhpl.log import log - def badIPDisplay(screen, the_ip): ButtonChoiceWindow(screen, _("Invalid IP string"), diff --git a/textw/packages_text.py b/textw/packages_text.py index 8f6bceefb..1cca2cdad 100644 --- a/textw/packages_text.py +++ b/textw/packages_text.py @@ -18,6 +18,9 @@ from rhpl.translate import _ from hdrlist import orderPackageGroups from hdrlist import ON_STATES, OFF_STATES +import logging +log = logging.getLogger("anaconda") + class PackageGroupWindow: # Unfortunately, the checkboxtree is callback-happy @@ -110,7 +113,7 @@ class PackageGroupWindow: elif grpset.groups.has_key(pkg): name = grpset.groups[pkg].name else: - log("unknown package %s" %(pkg,)) + log.warning("unknown package %s" %(pkg,)) continue gct.append(name, pkg, pkgselection[pkg][1]) diff --git a/textw/partition_text.py b/textw/partition_text.py index f60cc10c9..dd0786b15 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -29,9 +29,10 @@ from autopart import * from snack import * from constants_text import * -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") # sanity checking for various numeric input boxes def invalidInteger(str): @@ -220,7 +221,7 @@ class PartitionWindow: if request.uniqueID in origInfoDict.keys(): (request.requestSize, request.currentDrive) = origInfoDict[request.uniqueID] except: - log("Failed to restore original info") + log.error("Failed to restore original info") self.intf.messageWindow(_("Error Partitioning"), _("Could not allocate requested partitions: %s.") % (msg)) diff --git a/textw/progress_text.py b/textw/progress_text.py index 5ce899306..e989ff443 100644 --- a/textw/progress_text.py +++ b/textw/progress_text.py @@ -16,7 +16,8 @@ from snack import * from constants_text import * from rhpl.translate import _ -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") class InstallProgressWindow: def completePackage(self, header, timer): @@ -210,7 +211,7 @@ class setupForInstall: flag = 1 break - log("id.methodstr = %s %s", id.methodstr, flag) + log.info("id.methodstr = %s %s", id.methodstr, flag) id.setInstallProgressClass(InstallProgressWindow(screen, showdownload=flag)) return INSTALL_OK diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py index 217e5144c..1deb8655f 100644 --- a/textw/upgrade_text.py +++ b/textw/upgrade_text.py @@ -23,7 +23,6 @@ from constants import * import upgradeclass UpgradeClass = upgradeclass.InstallClass -from rhpl.log import log from rhpl.translate import _ class UpgradeMigrateFSWindow: diff --git a/textw/zfcp_text.py b/textw/zfcp_text.py index 7a4c9c328..f6189c68b 100644 --- a/textw/zfcp_text.py +++ b/textw/zfcp_text.py @@ -18,7 +18,6 @@ from constants import * from constants_text import * from rhpl.translate import _ from flags import flags -from rhpl.log import log import copy class ZFCPWindow: diff --git a/timezone.py b/timezone.py index c4ec9275d..ee8dfcd87 100644 --- a/timezone.py +++ b/timezone.py @@ -13,7 +13,9 @@ import iutil from flags import flags -from rhpl.log import log + +import logging +log = logging.getLogger("anaconda") def bool(val): if val: return "true" @@ -37,7 +39,7 @@ class Timezone: try: iutil.copyFile(fromFile, instPath + "/etc/localtime") except OSError, (errno, msg): - log ("Error copying timezone (from %s): %s" % (fromFile, msg)) + log.error("Error copying timezone (from %s): %s" % (fromFile, msg)) f = open(instPath + "/etc/sysconfig/clock", "w") diff --git a/upgrade.py b/upgrade.py index 1b5abe679..786d7713e 100644 --- a/upgrade.py +++ b/upgrade.py @@ -32,9 +32,11 @@ from constants import * from installmethod import FileCopyException from product import productName -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + # blacklist made up of (name, arch) or # (name, ) to erase all matches upgrade_remove_blacklist = () @@ -111,7 +113,7 @@ def mountRootPartition(intf, rootInfo, oldfsset, instPath, allowDirty = 0, lvm.vgscan() lvm.vgactivate() - log("going to mount %s on %s as %s" %(root, instPath, rootFs)) + log.info("going to mount %s on %s as %s" %(root, instPath, rootFs)) isys.mount(root, instPath, rootFs) oldfsset.reset() @@ -363,7 +365,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): # if we've been through here once for this root, then short-circuit if ((id.upgradeInfoFound is not None) and (id.upgradeInfoFound == id.upgradeRoot)): - log("already found packages to upgrade for %s" %(id.upgradeRoot,)) + log.info("already found packages to upgrade for %s" %(id.upgradeRoot,)) return else: id.upgradeInfoFound = id.upgradeRoot @@ -399,7 +401,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): try: os.unlink("%s/var/lib/rpm/%s" %(instPath, file)) except: - log("failed to unlink /var/lib/rpm/%s" %(file,)) + log.error("failed to unlink /var/lib/rpm/%s" %(file,)) packages = findpackageset.findpackageset(id.grpset.hdrlist.hdlist, instPath) @@ -448,12 +450,12 @@ def upgradeFindPackages(intf, method, id, instPath, dir): try: resetRpmdb(id.dbpath, instPath) except Exception, e: - log("error returning rpmdb to old state: %s" %(e,)) + log.critical("error returning rpmdb to old state: %s" %(e,)) pass sys.exit(0) else: - log("WARNING: upgrade between possibly incompatible " - "arches %s -> %s" %(h[rpm.RPMTAG_ARCH], myarch)) + log.warning("upgrade between possibly incompatible " + "arches %s -> %s" %(h[rpm.RPMTAG_ARCH], myarch)) mi = ts.dbMatch() found = 0 @@ -472,10 +474,10 @@ def upgradeFindPackages(intf, method, id, instPath, dir): if (string.find(release, "helix") > -1 or string.find(release, "ximian") > -1 or string.find(release, "eazel") > -1): - log("Third party package %s-%s-%s could cause problems." % - (h[rpm.RPMTAG_NAME], - h[rpm.RPMTAG_VERSION], - h[rpm.RPMTAG_RELEASE])) + log.warning("Third party package %s-%s-%s could cause problems." % + (h[rpm.RPMTAG_NAME], + h[rpm.RPMTAG_VERSION], + h[rpm.RPMTAG_RELEASE])) found = 1 if h[rpm.RPMTAG_NAME] == "XFree86" or h[rpm.RPMTAG_NAME] == "xorg-x11": hasX = 1 @@ -505,7 +507,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): try: resetRpmdb(id.dbpath, instPath) except Exception, e: - log("error returning rpmdb to old state: %s" %(e,)) + log.critical("error returning rpmdb to old state: %s" %(e,)) pass sys.exit(0) @@ -522,7 +524,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): try: resetRpmdb(id.dbpath, instPath) except Exception, e: - log("error returning rpmdb to old state: %s" %(e,)) + log.critical("error returning rpmdb to old state: %s" %(e,)) pass sys.exit(0) @@ -561,7 +563,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): try: resetRpmdb(id.dbpath, instPath) except Exception, e: - log("error returning rpmdb to old state: %s" %(e,)) + log.critical("error returning rpmdb to old state: %s" %(e,)) pass sys.exit(0) @@ -601,9 +603,9 @@ def upgradeFindPackages(intf, method, id, instPath, dir): # make sure the boot loader being used is being installed. # FIXME: generalize so that specific bits aren't needed if iutil.getArch() == "i386" and id.bootloader.useGrub(): - log("Upgrade: User selected to use GRUB for bootloader") + log.info("Upgrade: User selected to use GRUB for bootloader") if id.grpset.hdrlist.has_key("grub") and not id.grpset.hdrlist["grub"].isSelected(): - log("Upgrade: grub is not currently selected to be upgraded") + log.info("Upgrade: grub is not currently selected to be upgraded") h = None try: h = ts.dbMatch('name', 'grub').next() @@ -613,7 +615,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): text = ("Upgrade: GRUB is not already installed on the " "system, selecting GRUB") id.upgradeDeps ="%s%s\n" % (id.upgradeDeps, text) - log(text) + log.info(text) id.grpset.hdrlist["grub"].select() h = None @@ -622,7 +624,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): except StopIteration: pass if h is not None: - log("Upgrade: gnome-core was on the system. Upgrading to GNOME 2") + log.info("Upgrade: gnome-core was on the system. Upgrading to GNOME 2") upgraded = [] for pkg in ("gnome-terminal", "gnome-desktop", "gnome-session", "gnome-panel", "metacity", "file-roller", "yelp", @@ -639,7 +641,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): # since it works in both gnome and kde if (id.grpset.hdrlist.has_key("rhn-applet") and not id.grpset.hdrlist["rhn-applet"].isSelected()): - log("Upgrade: rhn-applet is not currently selected to be upgraded") + log.info("Upgrade: rhn-applet is not currently selected to be upgraded") h = None try: h = ts.dbMatch('name', 'up2date-gnome').next() @@ -657,7 +659,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): "system, but rhn-applet isn't. Selecting " "rhn-applet to be installed") id.upgradeDeps = "%s%s\n" % (id.upgradeDeps, text) - log(text) + log.info(text) id.grpset.hdrlist["rhn-applet"].select() # and since xterm is now split out from XFree86 (#98254) @@ -672,7 +674,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): text = ("Upgrade: XFree86 was on the system. Pulling in xterm " "for upgrade.") id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text) - log(text) + log.info(text) id.grpset.hdrlist["xterm"].select() # input methods all changed. hooray! @@ -687,7 +689,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): not id.grpset.hdrlist[new].isSelected()): text = "Upgrade: %s was on the system. Pulling in %s" %(old, new) id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text) - log(text) + log.info(text) id.grpset.hdrlist[new].select() iiimf = 1 if iiimf: @@ -707,7 +709,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): id.grpset.hdrlist[old].isSelected()): text = "Upgrade: Need iiimf base package %s" %(new,) id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text) - log(text) + log.info(text) id.grpset.hdrlist[new].select() # firefox replaces mozilla/netscape (#137244) @@ -720,7 +722,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): if found > 0: text = "Upgrade: Found a graphical browser. Pulling in firefox" id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text) - log(text) + log.info(text) id.grpset.hdrlist["firefox"].select() # now some upgrade removal black list checking... there are things that @@ -742,7 +744,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): if pkgarch is None: text = ("Upgrade: %s is on the system but will cause " "problems with the upgrade transaction. Removing." %(pkg,)) - log(text) + log.warning(text) id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text) id.upgradeRemove.append(pkgname) break @@ -751,7 +753,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): text = ("Upgrade: %s.%s is on the system but will " "cause problems with the upgrade transaction. " "Removing." %(pkgname,pkgarch)) - log(text) + log.warning(text) id.upgradeDeps = "%s%s\n" %(id.upgradeDeps, text) id.upgradeRemove.append(mi.instance()) @@ -781,7 +783,7 @@ def upgradeFindPackages(intf, method, id, instPath, dir): for pkgnevra in depcheck.added: text = ("Upgrade Dependency: Needs %s, " "automatically added." % (pkgnevra,)) - # log(text) + # log.info(text) id.upgradeDeps = "%s%s\n" % (id.upgradeDeps, text) win.pop() diff --git a/urlinstall.py b/urlinstall.py index 07dd02e7b..e27ad44d7 100644 --- a/urlinstall.py +++ b/urlinstall.py @@ -34,7 +34,8 @@ import ftplib import httplib import StringIO -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") FILENAME = 1000000 DISCNUM = 1000002 @@ -84,7 +85,7 @@ class UrlInstallMethod(InstallMethod): # if not local then assume its on host if fname is None: fname = '%s/%s/base/comps.xml' % (self.baseUrl, productPath) - log("Comps not in update dirs, using %s",fname) + log.warning("Comps not in update dirs, using %s",fname) return groupSetFromCompsFile(fname, hdlist) def getFilename(self, filename, callback=None, destdir=None, retry=1, @@ -109,8 +110,8 @@ class UrlInstallMethod(InstallMethod): try: rc=urlretrieve(fullPath, file, callback=callback) except IOError, (errnum, msg): - log("IOError %s occurred getting %s: %s" - %(errnum, fullPath.replace("%", "%%"), str(msg))) + log.critical("IOError %s occurred getting %s: %s" + %(errnum, fullPath.replace("%", "%%"), str(msg))) if not retry: raise FileCopyException @@ -149,8 +150,8 @@ class UrlInstallMethod(InstallMethod): try: urlretrieve(fullPath, file) except IOError, (errnum, msg): - log("IOError %s occurred getting %s: %s", - errnum, fullPath.replace("%", "%%"), str(msg)) + log.critical("IOError %s occurred getting %s: %s", + errnum, fullPath.replace("%", "%%"), str(msg)) time.sleep(5) else: break @@ -169,7 +170,8 @@ class UrlInstallMethod(InstallMethod): try: url = grabber.urlopen (hdurl, retry = 5) except grabber.URLGrabError, e: - log ("URLGrabError: %s occurred getting %s", e.strerror, hdurl) + log.critical ("URLGrabError: %s occurred getting %s", e.strerror, + hdurl) raise FileCopyException raw = url.read(16) @@ -21,7 +21,8 @@ import os import string from flags import flags -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") class Accounts: def __repr__(self): @@ -262,7 +263,7 @@ class Authentication: searchPath = 1, root = instPath) else: - log("Would have run %s", args) + log.error("Would have run %s", args) except RuntimeError, msg: - log ("Error running %s: %s", args, msg) + log.error("Error running %s: %s", args, msg) @@ -20,6 +20,9 @@ from rhpl.translate import _, N_ import network import isys +import logging +log = logging.getLogger("anaconda") + def hasActiveNetDev(): # try to load /tmp/netinfo and see if we can sniff out network info netinfo = network.Network() @@ -27,8 +30,8 @@ def hasActiveNetDev(): try: ip = isys.getIPAddress(dev) except Exception, e: - log("Got an exception trying to get the ip addr of %s: " - "%s" %(dev, e)) + log.error("Got an exception trying to get the ip addr of %s: " + "%s" %(dev, e)) continue if ip == '127.0.0.1' or ip is None: continue diff --git a/whiteout.py b/whiteout.py index 518e5c226..2c6280091 100644 --- a/whiteout.py +++ b/whiteout.py @@ -7,9 +7,11 @@ import os import rpm import rhpl.arch -from rhpl.log import log from flags import flags +import logging +log = logging.getLogger("anaconda") + # set DB_PRIVATE to make rpm happy... do it in here since we include # this with all of the useful rpm bits rpm.addMacro("__dbi_cdb", "create private mpool mp_mmapsize=16Mb mp_size=1Mb") @@ -24,9 +26,9 @@ if flags.selinux: if os.access(fn, os.R_OK): break rpm.addMacro("__file_context_path", fn) - log("setting file_context_path to %s" %(fn,)) + log.info("setting file_context_path to %s" %(fn,)) else: - log("setting file_context_path to nil") + log.info("setting file_context_path to nil") rpm.addMacro("__file_context_path", "%{nil}") whiteout=""" diff --git a/yuminstall.py b/yuminstall.py index 581985123..2172e1814 100644 --- a/yuminstall.py +++ b/yuminstall.py @@ -23,9 +23,11 @@ import yum.repos import yum.packages from syslogd import syslog -from rhpl.log import log from rhpl.translate import _ +import logging +log = logging.getLogger("anaconda") + import iutil class simpleCallback: @@ -19,8 +19,9 @@ import iutil import isys from rhpl.translate import _, N_ -from rhpl.log import log +import logging +log = logging.getLogger("anaconda") class ZFCP: def __init__(self): @@ -133,17 +134,17 @@ class ZFCP: fnu = ur % (fcpdevices[i][0],fcpdevices[i][2],) try: fo = open(fno, "w") - log("echo %s > %s" % (0, fno)) + log.info("echo %s > %s" % (0, fno)) fo.write("0") fo.close() try: fu = open(fnu, "w") - log("echo %s > %s" % (fcpdevices[i][4], fnu)) + log.info("echo %s > %s" % (fcpdevices[i][4], fnu)) fu.write("%s\n" % (fcpdevices[i][4],)) fu.close() try: fp = open(fnp, "w") - log("echo %s > %s" % (fcpdevices[i][2], fnp)) + log.info("echo %s > %s" % (fcpdevices[i][2], fnp)) fp.write("%s\n" % (fcpdevices[i][2],)) fp.close() except: @@ -166,27 +167,27 @@ class ZFCP: fnu = ua % (fcpdevices[i][0],fcpdevices[i][2],) try: fp = open(fnp, "w") - log("echo %s > %s" % (fcpdevices[i][2], fnp)) + log.info("echo %s > %s" % (fcpdevices[i][2], fnp)) fp.write("%s\n" % (fcpdevices[i][2],)) fp.close() try: fu = open(fnu, "w") - log("echo %s > %s" % (fcpdevices[i][4], fnu)) + log.info("echo %s > %s" % (fcpdevices[i][4], fnu)) fu.write("%s\n" % (fcpdevices[i][4],)) fu.close() try: fo = open(fno, "w") - log("echo %s > %s" % (1, fno)) + log.info("echo %s > %s" % (1, fno)) fo.write("1") fo.close() except: - log("opening %s failed" %(fno,)) + log.warning("opening %s failed" %(fno,)) continue except: - log("opening %s failed" %(fnu,)) + log.warning("opening %s failed" %(fnu,)) continue except: - log("opening %s failed" %(fnp,)) + log.warning("opening %s failed" %(fnp,)) continue def writeModprobeConf(self, fcpdevices): |