From abb5afcc79f55b56e1a62d3f065475a46e045b44 Mon Sep 17 00:00:00 2001 From: Josh Mize Date: Wed, 30 Sep 2015 19:45:38 -0500 Subject: [PATCH] Fix softlinkstatic to actually create symlinks --- docker/softlinkstatic.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docker/softlinkstatic.py b/docker/softlinkstatic.py index e7aa2edd1d4..b5bac680249 100755 --- a/docker/softlinkstatic.py +++ b/docker/softlinkstatic.py @@ -7,10 +7,11 @@ with open(STATIC) as static_fp: static_files = json.load(static_fp) -for path in static_files['paths']: - full_path = os.path.join('./static', path) - - try: - os.unlink(full_path) - except OSError: - pass +for orig, hashed in static_files['paths'].items(): + if '?' in orig: + continue + orig_path = os.path.join('./static', orig) + hashed_filename = os.path.split(hashed)[1] + # no exception handling b/c we want to abort on OS errors here + os.unlink(orig_path) + os.symlink(hashed_filename, orig_path)