You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
salt/0004-Jinja2-no-longer-build...

46 lines
1.2 KiB

From 56cf893eb2fb61a6010235eda2f35170cd81fefa Mon Sep 17 00:00:00 2001
From: Pedro Algarvio <pedro@algarvio.me>
Date: Wed, 16 Jan 2013 20:14:43 +0000
Subject: [PATCH] Jinja2 is no longer a build dependency. Fixes #3293.
---
salt/utils/templates.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/salt/utils/templates.py b/salt/utils/templates.py
index a75bcb4..60631ce 100644
--- a/salt/utils/templates.py
+++ b/salt/utils/templates.py
@@ -12,14 +12,10 @@
import tempfile
import traceback
-# Import third party libs
-import jinja2
-import jinja2.ext
-
# Import salt libs
import salt.utils
import salt.exceptions
-from salt.utils.jinja import SaltCacheLoader as JinjaSaltCacheLoader
+
log = logging.getLogger(__name__)
@@ -72,6 +68,12 @@ def render_tmpl(tmplsrc, from_str=False, to_str=False,
def render_jinja_tmpl(tmplstr, context, tmplpath=None):
+ # Late import Jinja2 to allow building salt without making it a build
+ # dependency
+ import jinja2
+ import jinja2.ext
+ from salt.utils.jinja import SaltCacheLoader as JinjaSaltCacheLoader
+
opts = context['opts']
env = context['env']
loader = None
--
1.7.10