small correction on fabric file
authorymh <ymh.work@gmail.com>
Thu, 29 Nov 2012 22:34:27 +0100
changeset 7 fc1eea0039d8
parent 6 740d11ae9e28
child 8 9847c70242cf
small correction on fabric file
sbin/sync/fabfile.py
--- a/sbin/sync/fabfile.py	Thu Nov 29 18:59:30 2012 +0100
+++ b/sbin/sync/fabfile.py	Thu Nov 29 22:34:27 2012 +0100
@@ -126,7 +126,8 @@
     
     with prefix("source %s" % activate_path):
         if module_to_uninstall:
-            run("pip uninstall %s" % module_to_uninstall)
+            with settings(warn_only=True):
+                run("pip uninstall -y %s" % module_to_uninstall)
         run("pip install \"%s\"" % remotepath)
 
 def collectstatic(remotepath, remotevirtualenvpath, platform_web_module):
@@ -140,12 +141,16 @@
         
 def create_config(export_path):    
     print("Create config from %s" % (export_path,))
-    remotepath = env.remote_path['web']
+    remotepath = env.remote_path['src']
     remote_config_path = os.path.join(remotepath, env.platform_web_module, "config.py")
-    template_path = os.path.join(export_path, "web", env.platform_web_module, "config.py.tmpl")
+    template_path = os.path.join(export_path, "src", env.platform_web_module, "config.py.tmpl")
     
     context = {
-        'base_dir': os.path.join(remotepath, env.platform_web_module).rstrip("/")+"/",   
+        'base_dir': os.path.join(remotepath, env.platform_web_module).rstrip("/")+"/",
+        'asctime': '%(asctime)s',
+        'levelname': '%(levelname)s',
+        'message': '%(message)s',
+        'module': '%(module)s',
     }
     context.update(env.config['web'])
     
@@ -226,7 +231,7 @@
     print("Relaunch server")
     check_folder_access()
     if do_collectstatic:
-        collectstatic(env.remote_path['web'], env.remote_path['virtualenv'], env.platform_web_module)
+        collectstatic(env.remote_path['src'], env.remote_path['virtualenv'], env.platform_web_module)
     sudo(env.web_relaunch_cmd, shell=False)
 
 @task