Commits

Brent Tubbs committed 85b29d3

fix problem writing supervisord include when deploying to multiple servers at once.

  • Participants
  • Parent commits deb5aee
  • Tags 0.3.11

Comments (0)

Files changed (3)

 
 setup(
     name='silk-deployment',
-    version='0.3.10',
+    version='0.3.11',
     author='Brent Tubbs',
     author_email='brent.tubbs@gmail.com',
 	packages=find_packages(),

File silk/fabfile.py

     # nginx to include files in /srv/<site>/conf, in addition to their default
     # include directories.  While this was valid for nginx, supervisord does
     # not allow for multiple "files" lines in its "include" section (it does
-    # allow for multiple globs on the single "files" line, though.  This command
-    # finds the offending pattern in /etc/supervisor/supervisord.conf and
-    # replaces it with the correct equivalent.
+    # allow for multiple globs on the single "files" line, though).  This
+    # command finds the offending pattern in /etc/supervisor/supervisord.conf
+    # and replaces it with the correct equivalent.
 
     # Note that Silk 0.3.0 and later does not require any changes from the
     # default supervisord.conf that ships with Ubuntu.  All files are included
 
 from app_container import *
 
-GUNICORN_DEFAULTS = {
-    'workers': 1,
-    'log-level': 'info',
-    'name': 'gunicorn',
-    'debug': 'false',
-}
 
 # Format for the 'bind' string we'll be making later, sticking the site name +
 # timestamp in the wildcard part.  Used here for generating the gunicorn cmd,
     """Given a copy of Fabric's state in site_env, configure and return the
     gunicorn cmd line needed to run the site"""
     site_config = site_env['config']
-    gconfig = copy.copy(GUNICORN_DEFAULTS)
-    gconfig = site_config.get('gunicorn', GUNICORN_DEFAULTS)
+
+    GUNICORN_DEFAULTS = {
+        'workers': 1,
+        'log-level': 'info',
+        'name': 'gunicorn',
+        'debug': 'false',
+    }
+
+    # Make a copy here because we're going to be modifying this dict, and we
+    # don't want to mess it up for later functions, or later runs of this
+    # function if we're going to deploy to more than one host.
+    gconfig = copy.copy(site_config.get('gunicorn', GUNICORN_DEFAULTS))
 
     # Default to using a unix socket for nginx->gunicorn
     if 'deployment' in site_env: