Commits

Alessandro Molina committed a32879f

Avoid creating empty production.ini files

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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.