From 8a48d5fa59535596fe9e4b53f3c1962510c8748e Mon Sep 17 00:00:00 2001 From: Goutte Date: Mon, 18 Dec 2017 15:45:16 +0100 Subject: [PATCH] Make sure spacepy's toolbox is up-to-date BEFORE we try to import pycdf, or it will fail miserably. --- web/run.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/run.py b/web/run.py index 85ff1e5..f1e5b26 100755 --- a/web/run.py +++ b/web/run.py @@ -1037,7 +1037,6 @@ def download_targets_cdf(targets, inp, started_at, stopped_at): log.debug("Creating the CDF file '%s'..." % cdf_filename) environ['SPACEPY'] = CACHE_DIR environ['CDF_LIB'] = CDF_LIB - from spacepy import pycdf try: # todo: maybe move this to the daily cache warmup ? log.info("Updating spacepy's table of leap seconds…") @@ -1046,6 +1045,11 @@ def download_targets_cdf(targets, inp, started_at, stopped_at): except Exception as e: log.error("Failed to update spacepy : %s." % e) try: + from spacepy import pycdf + except ImportError as e: + log.error("Failed to import pycdf from spacepy : %s" % e) + raise + try: cdf_handle = pycdf.CDF(cdf_path, masterpath='') description = "Model and orbit data for %s." % \ ', '.join([t['name'] for t in targets_configs]) -- libgit2 0.21.2