X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/1424bfacd82ffc238f90f1baa99388fc1ac9f2e7..08d8018f613bad8e07c510fdecc7392c798de8b8:/deployment.py?ds=sidebyside diff --git a/deployment.py b/deployment.py index a9a4f580..8f06d764 100644 --- a/deployment.py +++ b/deployment.py @@ -5,7 +5,7 @@ import os import sys import logging -logging.basicConfig(stream=sys.stderr, format="%(levelname)s:: %(message)s") +logging.basicConfig(stream=sys.stderr, format="%(levelname)s:: %(message)s", level=logging.INFO) from string import Template @@ -74,9 +74,11 @@ class DeploySite(object): self.restart_app() def find_resource(self, path): - full_path = os.path.join(self.env['APP_DIR'], path) - if os.path.isfile(full_path): - return full_path + for dir in (self.env['CONFIG_DIR'], self.env['APP_DIR']): + full_path = os.path.join(dir, path) + if os.path.isfile(full_path): + return full_path + raise ValueError("Resource '%s' not found" % path) @classmethod