~psivaa/uci-engine/lander-jenkins-plugin

« back to all changes in this revision

Viewing changes to image-builder/imagebuilder/wsgi.py

  • Committer: Paul Larson
  • Date: 2013-12-12 05:20:33 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: paul.larson@canonical.com-20131212052033-c4oouv82qrze3yty
Stub APIs and restish framework for image-builder

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# Ubuntu CI Services
 
3
# Copyright 2013 Canonical Ltd.
 
4
 
 
5
# This program is free software: you can redistribute it and/or modify it
 
6
# under the terms of the GNU Affero General Public License version 3, as
 
7
# published by the Free Software Foundation.
 
8
 
 
9
# This program is distributed in the hope that it will be useful, but
 
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
 
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
12
# PURPOSE.  See the GNU Affero General Public License for more details.
 
13
 
 
14
# You should have received a copy of the GNU Affero General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
import logging
 
18
from restish.app import RestishApp
 
19
 
 
20
from imagebuilder.resources.root import Root
 
21
 
 
22
logging.basicConfig(level=logging.DEBUG)
 
23
 
 
24
 
 
25
def make_app():
 
26
    """Build the wsgi app object."""
 
27
    app = RestishApp(Root())
 
28
    return app
 
29
 
 
30
app = make_app()
 
31
 
 
32
if __name__ == '__main__':
 
33
    from wsgiref.simple_server import make_server
 
34
    httpd = make_server('', 8000, app)
 
35
    try:
 
36
        httpd.serve_forever()
 
37
    except KeyboardInterrupt:
 
38
        print('exiting')
 
39
        pass