Commits

theoden  committed 21a8dfd

extra_context parameter added to utils.upload_config_template

  • Participants
  • Parent commits f22b898
  • Branches multiple web-servers

Comments (0)

Files changed (1)

File fab_deploy/utils.py

     return wrapper
 
 @task
-def upload_config_template(name, to=None, skip_unexistent=False, **kwargs):
+def upload_config_template(
+    name, to=None, skip_unexistent=False, extra_context=None, **kwargs
+):
     if to is None:
         base_dir = env.conf['ENV_DIR'] + "/etc/"
         run('mkdir -p ' + base_dir)
             return
         abort('Config template "%s" is not found' % name)
 
-    files.upload_template(config_template, to, env.conf, use_jinja=True,
+    context = deepcopy(env.conf)
+    if extra_context is not None:
+        context.update(extra_context)
+
+    files.upload_template(config_template, to, context, use_jinja=True,
                           **kwargs)
 
 def update_env():