diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 199: one thing missed for bug #897918

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

Commit Message

Paul Larson Jan. 23, 2012, 9:34 p.m. UTC
------------------------------------------------------------
revno: 199
committer: Paul Larson <paul.larson@linaro.org>
branch nick: lava-dispatcher
timestamp: Mon 2012-01-23 15:32:05 -0600
message:
  one thing missed 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	2012-01-17 23:29:04 +0000
+++ lava_dispatcher/utils.py	2012-01-23 21:32:05 +0000
@@ -66,9 +66,11 @@ 
                 os.makedirs(cache_dir)
             os.link(file_location, cache_loc)
         except OSError, err:
-            #errno 18 is Invalid cross-device link
-            if err.errno == 18:
+            #errno.EXDEV(18) is Invalid cross-device link
+            if err.errno == errno.EXDEV:
                 shutil.copy(file_location, cache_loc)
+            if err.errno == errno.EEXIST:
+                logging.info("Cached copy of %s already exists" % url)
             else:
                 logging.exception("os.link failed")
     return file_location