[yum-commits] Branch 'yum-3_2_X' - yum/__init__.py
skvidal at osuosl.org
skvidal at osuosl.org
Thu Sep 10 12:57:56 UTC 2009
yum/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit dff7bbeca721183f91f072c2e543c5210ad58cb6
Author: Seth Vidal <skvidal at fedoraproject.org>
Date: Wed Sep 9 16:09:59 2009 -0400
obscure locking error https://bugzilla.redhat.com/show_bug.cgi?id=521748
if, for some reason the lock/pid file can't be created b/c of an oserror
OTHER than 'file exists' then we shouldn't be raising the msg but creating
a new lockerror exception and passing on something like useful information
diff --git a/yum/__init__.py b/yum/__init__.py
index 8211c70..d13f7a9 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1259,7 +1259,10 @@ class YumBase(depsolve.Depsolve):
os.makedirs(lockdir, mode=0755)
fd = os.open(filename, os.O_EXCL|os.O_CREAT|os.O_WRONLY, mode)
except OSError, msg:
- if not msg.errno == errno.EEXIST: raise msg
+ if not msg.errno == errno.EEXIST:
+ # Whoa. What the heck happened?
+ errmsg = _('Could not create lock at %s: %s ') % (filename, str(msg))
+ raise Errors.LockError(msg.errno, errmsg, contents)
return 0
else:
os.write(fd, contents)
More information about the Yum-commits
mailing list