~fred-yang/nova/TrustedComputingPools

1 by Jesse Andrews
initial commit
1
#!/usr/bin/env python
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4
3
114 by Devin Carlen
Updated licenses
4
# Copyright 2010 United States Government as represented by the
3.1.9 by Vishvananda Ishaya
Removed trailing whitespace from header
5
# Administrator of the National Aeronautics and Space Administration.
114 by Devin Carlen
Updated licenses
6
# All Rights Reserved.
7
#
8
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
9
#    not use this file except in compliance with the License. You may obtain
10
#    a copy of the License at
11
#
12
#         http://www.apache.org/licenses/LICENSE-2.0
13
#
1 by Jesse Andrews
initial commit
14
#    Unless required by applicable law or agreed to in writing, software
114 by Devin Carlen
Updated licenses
15
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17
#    License for the specific language governing permissions and limitations
18
#    under the License.
19
1450.4.2 by Vishvananda Ishaya
more cleanup of binaries per review
20
"""Daemon for nova objectstore. Supports S3 API."""
21
22
import eventlet
23
eventlet.monkey_patch()
24
265.1.1 by Soren Hansen
Make the scripts in bin/ detect if they're being run from a bzr checkout
25
import os
26
import sys
27
28
# If ../nova/__init__.py exists, add ../ to Python search path, so that
29
# it will override what happens to be installed in /usr/(local/)lib/python...
30
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
31
                                   os.pardir,
32
                                   os.pardir))
33
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
34
    sys.path.insert(0, possible_topdir)
35
454.2.2 by jaypipes at gmail
For some reason, I forgot to commit the other endpoints...
36
1 by Jesse Andrews
initial commit
37
from nova import flags
881.1.2 by termie
port s3server to eventlet/wsgi
38
from nova import log as logging
1450.4.2 by Vishvananda Ishaya
more cleanup of binaries per review
39
from nova import service
1 by Jesse Andrews
initial commit
40
from nova import utils
881.1.2 by termie
port s3server to eventlet/wsgi
41
from nova import wsgi
42
from nova.objectstore import s3server
1 by Jesse Andrews
initial commit
43
44
45
FLAGS = flags.FLAGS
46
47
48
if __name__ == '__main__':
430.1.1 by Michael Gundlach
Move default_flagfile() call to where it will be parsed in time to load the flagfile
49
    utils.default_flagfile()
881.1.2 by termie
port s3server to eventlet/wsgi
50
    FLAGS(sys.argv)
51
    logging.setup()
1450.7.1 by Nachi Ueno
Added monkey patching notification code function
52
    utils.monkey_patch()
881.1.2 by termie
port s3server to eventlet/wsgi
53
    router = s3server.S3Application(FLAGS.buckets_path)
1198.1.25 by Brian Lamar
Removed whitespace.
54
    server = wsgi.Server("S3 Objectstore",
55
                         router,
56
                         port=FLAGS.s3_port,
1198.1.23 by Brian Lamar
Very small alterations, switched from using start() to pass host/port, to just defining them up front in init. Doesn't make sense to set them in start because we can't start more than once any way. Also, unbroke binaries.
57
                         host=FLAGS.s3_host)
1450.4.2 by Vishvananda Ishaya
more cleanup of binaries per review
58
    service.serve(server)
59
    service.wait()