summaryrefslogtreecommitdiffstats
path: root/image.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-07-24 03:32:00 +0000
committerMike Fulbright <msf@redhat.com>2002-07-24 03:32:00 +0000
commitdf67449c99f83b1a7ad69dbc5ea3e8517d93708d (patch)
treea44781ad4aabf06f445c5e34590d9015803f20b2 /image.py
parent166d1a7039821376b586bbeca3b2e49c55311260 (diff)
downloadanaconda-df67449c99f83b1a7ad69dbc5ea3e8517d93708d.tar.gz
anaconda-df67449c99f83b1a7ad69dbc5ea3e8517d93708d.tar.xz
anaconda-df67449c99f83b1a7ad69dbc5ea3e8517d93708d.zip
good idea to close a file when you're done with it if you intend to umount the file system its on
Diffstat (limited to 'image.py')
-rw-r--r--image.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/image.py b/image.py
index 73b3ec514..58e65769c 100644
--- a/image.py
+++ b/image.py
@@ -17,6 +17,7 @@ import iutil
import os
import isys
import time
+import stat
import kudzu
import string
import shutil
@@ -237,7 +238,8 @@ def findIsoImages(path, messageWindow):
for file in files:
what = path + '/' + file
- if not isys.isIsoImage(what): continue
+ if not isys.isIsoImage(what):
+ continue
isys.makeDevInode("loop2", "/tmp/loop2")
@@ -251,20 +253,21 @@ def findIsoImages(path, messageWindow):
readOnly = 1)
for num in range(1, 10):
if os.access("/mnt/cdimage/.discinfo", os.R_OK):
- f = open("/mnt/cdimage/.discinfo");
+ f = open("/mnt/cdimage/.discinfo")
try:
f.readline() # skip timestamp
f.readline() # skip release description
- discArch = f.readline() # read architecture
+ discArch = string.strip(f.readline()) # read architecture
discNum = string.atoi(f.readline()) # read disc number
except:
discArch = None
discNum = 0
+
+ f.close()
+
if discNum != num or discArch != arch:
continue
- import stat
-
# warn user if images appears to be wrong size
if os.stat(what)[stat.ST_SIZE] % 2048:
rc = messageWindow(_("Warning"),