[PATCH] applydeltarpm: turn fork() failure to MiscError. BZ 1028334

Zdenek Pavlas zpavlas at redhat.com
Fri Nov 8 09:32:18 UTC 2013


This is fatal, ignoring or retrying spawnl() makes not sense.
Just turn OSError to MiscError to avoid traceback, and make
it a bit more descriptive.
---
 yum/drpm.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/yum/drpm.py b/yum/drpm.py
index d00cf1c..1fd7a11 100644
--- a/yum/drpm.py
+++ b/yum/drpm.py
@@ -18,7 +18,7 @@
 #      Boston, MA  02111-1307  USA
 
 from yum.constants import TS_UPDATE
-from yum.Errors import RepoError
+from yum.Errors import RepoError, MiscError
 from yum.i18n import exception2msg, _
 from yum.Errors import MiscError
 from yum.misc import checksum, repo_gen_decompress, unlink_f
@@ -334,6 +334,9 @@ class DeltaInfo:
         if po.oldrpm: args += '-r', po.oldrpm
         args += po.localpath, po.rpm.localpath
 
-        pid = os.spawnl(os.P_NOWAIT, APPLYDELTA, APPLYDELTA, *args)
+        try:
+            pid = os.spawnl(os.P_NOWAIT, APPLYDELTA, APPLYDELTA, *args)
+        except OSError, e:
+            raise MiscError, _('Couldn\'t spawn %s: %s') % (APPLYDELTA, exception2msg(e))
         self.jobs[pid] = po
         return True
-- 
1.7.11.7



More information about the Yum-devel mailing list