Permalink
Browse files

[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.
  • Loading branch information...
1 parent 5ab9dc2 commit e79053747097eb8ac73f5e9145a7b9fcbf8f7330 wohali committed Mar 14, 2013
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

0 comments on commit e790537

Please sign in to comment.