Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[COOK-2599] gunicorn provider fails if no node['cpu']['total'] #23

Merged
merged 1 commit into from

2 participants

@wohali

ohai does not populate node['cpu'] on SmartOS today.
To prevent this blocking use of application_python I suggest
this workaround.

wohali [COOK-2599] gunicorn provider fails if no node['cpu']['total']
ohai does not populate node['cpu'] on SmartOS today.
To prevent this blocking use of application_python I suggest
this workaround.
e790537
@jtimberman jtimberman merged commit 14141b7 into poise:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2013
  1. [COOK-2599] gunicorn provider fails if no node['cpu']['total']

    wohali authored
    ohai does not populate node['cpu'] on SmartOS today.
    To prevent this blocking use of application_python I suggest
    this workaround.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  resources/gunicorn.rb
View
2  resources/gunicorn.rb
@@ -26,7 +26,7 @@
attribute :host, :kind_of => String, :default => '0.0.0.0'
attribute :port, :kind_of => Integer, :default => 8080
attribute :backlog, :kind_of => Integer, :default => 2048
-attribute :workers, :kind_of => Integer, :default => [node['cpu']['total'].to_i * 4, 8].min
+attribute :workers, :kind_of => Integer, :default => (node['cpu'] && node['cpu']['total']) && [node['cpu']['total'].to_i * 4, 8].min || 8
attribute :worker_class, :kind_of => [String, Symbol], :default => :sync
attribute :worker_connections, :kind_of => Integer, :default => 1000
attribute :max_requests, :kind_of => Integer, :default => 0
Something went wrong with that request. Please try again.