[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 138: record why os.link failed too

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

Commit Message

Michael-Doyle Hudson Oct. 18, 2011, 3:04 a.m.
------------------------------------------------------------
revno: 138
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: trunk
timestamp: Tue 2011-10-18 16:02:02 +1300
message:
  record why os.link failed too
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

Patch

=== modified file 'lava_dispatcher/utils.py'
--- lava_dispatcher/utils.py	2011-10-18 02:38:34 +0000
+++ lava_dispatcher/utils.py	2011-10-18 03:02:02 +0000
@@ -52,6 +52,8 @@ 
         except OSError, err:
             if err.errno == 18:
                 shutil.copy(cache_loc, file_location)
+            else:
+                logging.exception("os.link failed")
     else:
         file_location = download(url, path)
         try:
@@ -63,9 +65,8 @@ 
             #errno 18 is Invalid cross-device link
             if err.errno == 18:
                 shutil.copy(file_location, cache_loc)
-            #If this fails for any other reason, it will be because
-            #another test is pulling the same image at the same time,
-            #so ignore
+            else:
+                logging.exception("os.link failed")
     return file_location
 
 def url_to_cache(url, cachedir):