diff --git a/rattail_fabric/core.py b/rattail_fabric/core.py index f409f15..0cf8a9e 100644 --- a/rattail_fabric/core.py +++ b/rattail_fabric/core.py @@ -137,10 +137,14 @@ def upload_mako_template(local_path, remote_path, context={}, encoding='utf_8', """ template = Template(filename=local_path) + # make copy of context; add env to it + context = dict(context) + context['env'] = env + temp_dir = tempfile.mkdtemp(prefix='rattail-fabric.') temp_path = os.path.join(temp_dir, os.path.basename(local_path)) with open(temp_path, 'wb') as f: - text = template.render(env=env, **context) + text = template.render(**context) f.write(text.encode(encoding)) os.chmod(temp_path, os.stat(local_path).st_mode)