Message ID | 20120123213413.26764.4481.launchpad@ackee.canonical.com |
---|---|
State | Accepted |
Headers | show |
=== 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