diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 193: Fix for bug 897918

Message ID 20120117233318.30760.81486.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Paul Larson Jan. 17, 2012, 11:33 p.m. UTC
Merge authors:
  Paul Larson <paul.larson@linaro.org>
Related merge proposals:
  https://code.launchpad.net/~pwlars/lava-dispatcher/fix-897918/+merge/88440
  proposed by: Paul Larson (pwlars)
  review: Needs Fixing - Zygmunt Krynicki (zkrynicki)
------------------------------------------------------------
revno: 193 [merge]
committer: Paul Larson <paul.larson@linaro.org>
branch nick: lava-dispatcher
timestamp: Tue 2012-01-17 17:31:15 -0600
message:
  Fix for bug 897918
modified:
  lava_dispatcher/utils.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/utils.py'
--- lava_dispatcher/utils.py	2011-11-24 04:07:12 +0000
+++ lava_dispatcher/utils.py	2012-01-17 23:29:04 +0000
@@ -18,6 +18,7 @@ 
 # along
 # with this program; if not, see <http://www.gnu.org/licenses>.
 
+import errno
 import logging
 import os
 import shutil
@@ -51,8 +52,10 @@ 
         try:
             os.link(cache_loc, file_location)
         except OSError, err:
-            if err.errno == 18:
+            if err.errno == errno.EXDEV:
                 shutil.copy(cache_loc, file_location)
+            if err.errno == errno.EEXIST:
+                logging.info("Cached copy of %s already exists" % url)
             else:
                 logging.exception("os.link failed")
     else: