1414# limitations under the License.
1515#
1616
17+ include_recipe 'poise-python'
18+
1719# For netstat in serverspec.
1820package 'net-tools'
1921
2022application '/opt/wsgi1' do
2123 file '/opt/wsgi1/main.py' do
22- content <<-EOH
24+ content <<-' EOH'
2325def application(environ, start_response):
2426 status = '200 OK'
2527 response_headers = [('Content-type', 'text/plain')]
2628 start_response(status, response_headers)
27- return ['Hello world!\\ n']
29+ return ['Hello world!\n']
2830EOH
2931 end
3032 gunicorn do
@@ -37,3 +39,45 @@ def application(environ, start_response):
3739 port 8001
3840 end
3941end
42+
43+ application '/opt/wsgi2' do
44+ file "#{ path } /main.py" do
45+ content <<-'EOH'
46+ import sys
47+ def application(environ, start_response):
48+ status = '200 OK'
49+ response_headers = [('Content-type', 'text/plain')]
50+ start_response(status, response_headers)
51+ return ['\n'.join(sys.path)]
52+ EOH
53+ end
54+ gunicorn do
55+ port 8002
56+ end
57+ end
58+
59+ application '/opt/wsgi3' do
60+ file "#{ path } /requirements.txt" do
61+ content <<-EOH
62+ requests
63+ six
64+ EOH
65+ end
66+ virtualenv
67+ pip_requirements
68+ file "#{ path } /main.py" do
69+ content <<-'EOH'
70+ import sys
71+ import requests
72+ def application(environ, start_response):
73+ status = '200 OK'
74+ response_headers = [('Content-type', 'text/plain')]
75+ start_response(status, response_headers)
76+ return ['\n'.join(sys.path)]
77+ EOH
78+ end
79+ gunicorn do
80+ port 8003
81+ end
82+ end
83+
0 commit comments