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