[Yum-devel] [PATCH] obscure locking error https://bugzilla.redhat.com/show_bug.cgi?id=521748
Tim Lauridsen
tim.lauridsen at googlemail.com
Thu Sep 10 06:30:41 UTC 2009
On 09/09/2009 10:22 PM, Seth Vidal wrote:
> 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
> ---
> yum/__init__.py | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> 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)
>
Looks fine to me
Tim
More information about the Yum-devel
mailing list