summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2006-06-22 18:53:13 +0000
committerChris Lumens <clumens@redhat.com>2006-06-22 18:53:13 +0000
commitddfe70e7889734f8d90443b22df585ba4a342c9d (patch)
treec1be7c09880af92fb73e4f0e55a237ec6165b882
parenta8510cf3169b2dabc5161529ac73ccfd9ade6eab (diff)
downloadanaconda-ddfe70e7889734f8d90443b22df585ba4a342c9d.tar.gz
anaconda-ddfe70e7889734f8d90443b22df585ba4a342c9d.tar.xz
anaconda-ddfe70e7889734f8d90443b22df585ba4a342c9d.zip
A couple more things pykickstart found. Some of these are even bugs.
-rw-r--r--ChangeLog4
-rw-r--r--bootloader.py5
-rw-r--r--partitioning.py12
-rw-r--r--upgrade.py25
4 files changed, 17 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index f867c05ab..d82f1adc1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,10 @@
added for themselves.
* autopart.py: Some minor cleanups suggested by pychecker.
+ * bootloader.py: Likewise.
+ * partitioning.py: Likewise.
+ * upgrade.py: Likewise.
+
* partErrors.py (PartitioningError, PartitioningWarning): These
should inherit from Exception, since that's what they are.
diff --git a/bootloader.py b/bootloader.py
index a4f8cb33e..692a18c49 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -15,11 +15,8 @@
#
import isys
-import partitioning
import partedUtils
import os
-import crypt
-import language
import iutil
import string
import rhpl
@@ -193,7 +190,7 @@ def writeBootloader(anaconda):
except bootloaderInfo.BootyNoKernelWarning:
if not justConfigFile:
w.pop()
- if intf:
+ if anaconda.intf:
anaconda.intf.messageWindow(_("Warning"),
_("No kernel packages were installed on your "
"system. Your boot loader configuration "
diff --git a/partitioning.py b/partitioning.py
index 0a6d5e28e..806420d38 100644
--- a/partitioning.py
+++ b/partitioning.py
@@ -16,24 +16,12 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
-if __name__ == "__main__":
- import sys
- sys.path.append ("isys")
-
import isys
-import parted
-import raid
-import fsset
-import os
import sys
-import string
import iutil
-import partedUtils
-import raid
from constants import *
from flags import flags
from partErrors import *
-import partRequests
from rhpl.translate import _
diff --git a/upgrade.py b/upgrade.py
index c332d66cb..d9cf89f46 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -21,7 +21,6 @@ import sys
import os.path
import partedUtils
import string
-import shutil
import lvm
from flags import flags
from fsset import *
@@ -119,7 +118,7 @@ def getDirtyDevString(dirtyDevs):
return ret
def mountRootPartition(anaconda, rootInfo, oldfsset, allowDirty = 0,
- raiseErrors = 0, warnDirty = 0, readOnly = 0):
+ warnDirty = 0, readOnly = 0):
(root, rootFs) = rootInfo
diskset = partedUtils.DiskSet()
@@ -132,7 +131,7 @@ def mountRootPartition(anaconda, rootInfo, oldfsset, allowDirty = 0,
isys.mount(root, anaconda.rootPath, rootFs)
oldfsset.reset()
- newfsset = fsset.readFstab(anaconda.rootPath + '/etc/fstab', anaconda.intf)
+ newfsset = readFstab(anaconda.rootPath + '/etc/fstab', anaconda.intf)
for entry in newfsset.entries:
oldfsset.add(entry)
@@ -168,7 +167,7 @@ def mountRootPartition(anaconda, rootInfo, oldfsset, allowDirty = 0,
raise RuntimeError, "/etc/fstab did not list a fstype for the root partition which we support"
def bindMountDevDirectory(instPath):
- fs = fsset.fileSystemTypeGet("bind")
+ fs = fileSystemTypeGet("bind")
fs.mount("/dev", "%s/dev" % (instPath,), bindMount=1)
# returns None if no filesystem exist to migrate
@@ -193,7 +192,7 @@ def upgradeSwapSuggestion(anaconda):
# don't do this if we have more then 250 MB
if mem > 250:
- dispatch.skipStep("addswap", 1)
+ anaconda.dispatch.skipStep("addswap", 1)
return
swap = iutil.swapAmount() / 1024
@@ -212,7 +211,7 @@ def upgradeSwapSuggestion(anaconda):
fsList = []
for entry in anaconda.id.fsset.entries:
- if entry.fsystem.getName() in fsset.getUsableLinuxFs():
+ if entry.fsystem.getName() in getUsableLinuxFs():
if flags.setupFilesystems and not entry.isMounted():
continue
space = isys.pathSpaceAvailable(anaconda.rootPath + entry.mountpoint)
@@ -287,13 +286,13 @@ def upgradeMountFilesystems(anaconda):
try:
mountRootPartition(anaconda, anaconda.id.upgradeRoot[0], anaconda.id.fsset,
allowDirty = 0)
- except SystemError, msg:
+ except SystemError:
anaconda.intf.messageWindow(_("Mount failed"),
_("One or more of the file systems listed in the "
"/etc/fstab on your Linux system cannot be mounted. "
"Please fix this problem and try to upgrade again."))
sys.exit(0)
- except RuntimeError, msg:
+ except RuntimeError:
anaconda.intf.messageWindow(_("Mount failed"),
_("One or more of the file systems listed in the "
"/etc/fstab of your Linux system are inconsistent and "
@@ -341,13 +340,13 @@ def upgradeMountFilesystems(anaconda):
bindMountDevDirectory(anaconda.rootPath)
else:
if not os.access (anaconda.rootPath + "/etc/fstab", os.R_OK):
- rc = anaconda.intf.messageWindow(_("Warning"),
- _("%s not found")
- % (anaconda.rootPath + "/etc/fstab",),
- type="ok")
+ anaconda.intf.messageWindow(_("Warning"),
+ _("%s not found")
+ % (anaconda.rootPath + "/etc/fstab",),
+ type="ok")
return DISPATCH_BACK
- newfsset = fsset.readFstab(anaconda.rootPath + '/etc/fstab', anaconda.intf)
+ newfsset = readFstab(anaconda.rootPath + '/etc/fstab', anaconda.intf)
for entry in newfsset.entries:
anaconda.id.fsset.add(entry)