Commits

Alessandro Molina committed a32879f

Avoid creating empty production.ini files

  • Participants
  • Parent commits 8e06aee

Comments (0)

Files changed (1)

gearboxtools/deploy_circus/command.py

 
 class CircusDeployCommand(Command):
     TEMPLATE = Template('''
+[env:$app_name]
+PATH=$virtual_env/bin:$$PATH
+VIRTUAL_ENV=$virtual_env
+
 [watcher:$app_name]
-env = PATH=$virtual_env/bin,VIRTUAL_ENV=$virtual_env
 working_dir = $appdir
 cmd = chaussette --backend $backend --fd $$(circus.sockets.$app_name) paste:$config_file
 use_sockets = True
 
         parser.add_argument("-l", "--logging-dir",
             help='Directory where to store logging files by default',
-            dest='logging_dir', default='/var/log')
+            dest='logging_dir', default='/var/log/circus')
 
         parser.add_argument("-b", "--backend",
             help='Chaussette backend used to serve requests',
                 section, name = name.split('@', 1)
             skeleton_config.set(section, name, value)
 
-        with closing(open(config_file, 'w')) as config_file:
-            skeleton_config.write(config_file)
+        if skeleton_config.sections():
+            with closing(open(config_file, 'w')) as config_file:
+                skeleton_config.write(config_file)
 
     def _get_app_and_port(self, config_file):
         conf = ConfigParser()