Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

gunicorn v1.0.0, ensure server_hooks hash keys are symbols before com…

…pare
  • Loading branch information...
commit 0e092a73087ee571e7adfd502327d0bf2f9a18b6 1 parent daf4995
@schisamo schisamo authored
View
4 gunicorn/metadata.json
@@ -1,7 +1,7 @@
{
"name": "gunicorn",
"description": "Installs/Configures Gunicorn",
- "long_description": "Description\n===========\n\nInstalls and configures the latest version of Gunicorn (via pip), aka `Green Unicorn`, a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. Includes an LWRP for managing Gunicorn config files.\n\nRequirements\n============\n\nPlatform\n--------\n\n* Debian, Ubuntu\n* CentOS, Red Hat, Fedora\n\nCookbooks\n---------\n\n* python\n\nAttributes\n==========\n\nNone at this time.\n\nResource/Provider\n=================\n\nThis cookbook includes LWRPs for managing gunicorn config files.\n\n`gunicorn_config`\n-----------------\n\nCreates a Gunicorn configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the `appliation::gunicorn` recipe for a complete working example. In depth information about Gunicorn's configuration values can be [found in the Gunicorn documentation](http://gunicorn.org/configure.html).\n\n# Actions\n\n- :create: create a Gunicorn configuration file.\n- :delete: delete an existing Gunicorn configuration file.\n\n# Attribute Parameters\n\n- path: name attribute. The path where the configuration file will be created\n- template: template to use when rendering the configuration file. default is `gunicorn.py.erb` (part of this cookbook)\n- cookbook: cookbook to look for template file in. default is this cookbook `gunicorn`\n- listen: the socket to bind to. A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'. default is `0.0.0.0:8000` or listen on port 8000 on all interfaces\n- backlog: The maximum number of pending connections. default is `2048`\n- preload_app: Whether application code should be loaded before the worker processes are forked. default is `false`\n- worker_processes: The number of worker process for handling requests. default is `4`\n- worker_class: The type of workers to use. default is `sync`\n- worker_timeout: The number of seconds to wait before a worker is killed and restarted. default is `60`\n- worker_keepalive: The number of seconds to wait for requests on a Keep-Alive connection. default is `2`\n- worker_max_requests: The maximum number of requests a worker will process before restarting. default is `0` or restarts disabled\n- server_hooks: A hash with whose values will be rendered as a [Gunicorn server hook](http://gunicorn.org/configure.html#server-hooks) callables (functions) named after the hash item's key name. default is `{}` or no serves hooks\n- owner: The owner for the configuration file.\n- group: The group owner of the configuration file (string or id).\n- pid: A filename to use for the PID file. default is no pidfile\n\n# Example\n \n # create a config with the default values\n gunicorn_config \"/etc/gunicorn/myapp.py\" do\n action :create\n end\n \n # tweak some worker related values...we're web scale baby\n gunicorn_config \"/etc/gunicorn/myapp.py\" do\n worker_processes 8\n backlog 4096\n action :create\n end\n \n # use the 'pre_fork' server hook to \n # sleep for a second before forking\n gunicorn_config \"/etc/gunicorn/myapp.py\" do\n server_hooks({:pre_fork => 'import time;time.sleep(1)'})\n action :create\n end\n \nUsage\n=====\n\nSimply include the recipe where you want Gunicorn installed.\n\nLicense and Author\n==================\n\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\n\nCopyright:: 2011, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
+ "long_description": "Description\n===========\n\nInstalls and configures the latest version of Gunicorn (via pip), aka `Green Unicorn`, a Python WSGI HTTP Server for UNIX. It's a pre-fork worker model ported from Ruby's Unicorn project. Includes an LWRP for managing Gunicorn config files. By default Gunicorn is installed system-wide but you can target a particular `virtualenv` by overriding the `node[\"gunicorn\"][\"virtualenv\"]` attribute.\n\nRequirements\n============\n\nPlatform\n--------\n\n* Debian, Ubuntu\n* CentOS, Red Hat, Fedora\n\nCookbooks\n---------\n\n* python\n\nAttributes\n==========\n\n* `node[\"gunicorn\"][\"virtualenv\"]` - the virtualenv you want to target Gunicorn installation into. The virtualenv will be created if it doesn't exist.\n\nResource/Provider\n=================\n\nThis cookbook includes LWRPs for managing gunicorn config files.\n\n`gunicorn_config`\n-----------------\n\nCreates a Gunicorn configuration file at the path specified. Meant to be deployed with a service init scheme/supervisor such as runit. Please see the `appliation::gunicorn` recipe for a complete working example. In depth information about Gunicorn's configuration values can be [found in the Gunicorn documentation](http://gunicorn.org/configure.html).\n\n# Actions\n\n- :create: create a Gunicorn configuration file.\n- :delete: delete an existing Gunicorn configuration file.\n\n# Attribute Parameters\n\n- path: name attribute. The path where the configuration file will be created\n- template: template to use when rendering the configuration file. default is `gunicorn.py.erb` (part of this cookbook)\n- cookbook: cookbook to look for template file in. default is this cookbook `gunicorn`\n- listen: the socket to bind to. A string of the form: 'HOST', 'HOST:PORT', 'unix:PATH'. default is `0.0.0.0:8000` or listen on port 8000 on all interfaces\n- backlog: The maximum number of pending connections. default is `2048`\n- preload_app: Whether application code should be loaded before the worker processes are forked. default is `false`\n- worker_processes: The number of worker process for handling requests. default is `4`\n- worker_class: The type of workers to use. default is `sync`\n- worker_timeout: The number of seconds to wait before a worker is killed and restarted. default is `60`\n- worker_keepalive: The number of seconds to wait for requests on a Keep-Alive connection. default is `2`\n- worker_max_requests: The maximum number of requests a worker will process before restarting. default is `0` or restarts disabled\n- server_hooks: A hash with whose values will be rendered as a [Gunicorn server hook](http://gunicorn.org/configure.html#server-hooks) callables (functions) named after the hash item's key name. default is `{}` or no serves hooks\n- owner: The owner for the configuration file.\n- group: The group owner of the configuration file (string or id).\n- pid: A filename to use for the PID file. default is no pidfile\n\n# Example\n \n # create a config with the default values\n gunicorn_config \"/etc/gunicorn/myapp.py\" do\n action :create\n end\n \n # tweak some worker related values...we're web scale baby\n gunicorn_config \"/etc/gunicorn/myapp.py\" do\n worker_processes 8\n backlog 4096\n action :create\n end\n \n # use the 'pre_fork' server hook to \n # sleep for a second before forking\n gunicorn_config \"/etc/gunicorn/myapp.py\" do\n server_hooks({:pre_fork => 'import time;time.sleep(1)'})\n action :create\n end\n \nUsage\n=====\n\nSimply include the recipe where you want Gunicorn installed.\n\nLicense and Author\n==================\n\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\n\nCopyright:: 2011, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"maintainer": "Opscode, Inc.",
"maintainer_email": "cookbooks@opscode.com",
"license": "Apache 2.0",
@@ -28,5 +28,5 @@
},
"recipes": {
},
- "version": "0.99.0"
+ "version": "1.0.0"
}
View
2  gunicorn/metadata.rb
@@ -3,6 +3,6 @@
license "Apache 2.0"
description "Installs/Configures Gunicorn"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "0.99.0"
+version "1.0.0"
depends "python"
View
2  gunicorn/resources/config.rb
@@ -47,5 +47,5 @@
private
def self.validate_server_hook_hash_keys(server_hooks)
- server_hooks.keys.reject{|key| VALID_SERVER_HOOK_NAMES.include?(key)}.empty?
+ server_hooks.keys.reject{|key| VALID_SERVER_HOOK_NAMES.include?(key.to_sym)}.empty?
end
Please sign in to comment.
Something went wrong with that request. Please try again.