summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--iutil.py8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 40dd8c044..949e3b738 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-04 Peter Jones <pjones@redhat.com>
+
+ * iutil.py (mkdirChain): Don't log an error just because we're making
+ a directory that already exists.
+
2007-01-04 Jeremy Katz <katzj@redhat.com>
* loader2/modules.c (scsiDiskCount): Include cdroms in the count
diff --git a/iutil.py b/iutil.py
index d2bf0e736..02eccfcb7 100644
--- a/iutil.py
+++ b/iutil.py
@@ -15,6 +15,7 @@
import os, isys, string, stat
import os.path
+from errno import *
import rhpl
import warnings
import subprocess
@@ -156,8 +157,13 @@ def mkdirChain(dir):
try:
os.makedirs(dir, 0755)
except OSError, (errno, msg):
+ try:
+ if errno == EEXIST and stat.S_ISDIR(os.stat(dir).st_mode):
+ return
+ except:
+ pass
+
log.error("could not create directory %s: %s" % (dir, msg))
- pass
def swapAmount():
f = open("/proc/meminfo", "r")