Replace tornado objectstore with twisted web.
This commit is contained in:
@@ -18,33 +18,32 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Tornado daemon for nova objectstore. Supports S3 API.
|
Twisted daemon for nova objectstore. Supports S3 API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from tornado import httpserver
|
|
||||||
from tornado import ioloop
|
|
||||||
|
|
||||||
from nova import flags
|
from nova import flags
|
||||||
from nova import server
|
|
||||||
from nova import utils
|
from nova import utils
|
||||||
from nova.auth import users
|
from nova import twistd
|
||||||
from nova.objectstore import handler
|
from nova.objectstore import handler
|
||||||
|
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
|
||||||
def main(argv):
|
def main():
|
||||||
# FIXME: if this log statement isn't here, no logging
|
# FIXME: if this log statement isn't here, no logging
|
||||||
# appears from other files and app won't start daemonized
|
# appears from other files and app won't start daemonized
|
||||||
logging.debug('Started HTTP server on %s' % (FLAGS.s3_internal_port))
|
logging.debug('Started HTTP server on %s' % (FLAGS.s3_port))
|
||||||
app = handler.Application(users.UserManager())
|
app = handler.get_application()
|
||||||
server = httpserver.HTTPServer(app)
|
print app
|
||||||
server.listen(FLAGS.s3_internal_port)
|
return app
|
||||||
ioloop.IOLoop.instance().start()
|
|
||||||
|
|
||||||
|
|
||||||
|
# NOTE(soren): Stolen from nova-compute
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
twistd.serve(__file__)
|
||||||
|
|
||||||
|
if __name__ == '__builtin__':
|
||||||
utils.default_flagfile()
|
utils.default_flagfile()
|
||||||
server.serve('nova-objectstore', main)
|
application = main()
|
||||||
|
|||||||
2
debian/control
vendored
2
debian/control
vendored
@@ -91,7 +91,7 @@ Description: Nova Cloud Computing - API frontend
|
|||||||
|
|
||||||
Package: nova-objectstore
|
Package: nova-objectstore
|
||||||
Architecture: all
|
Architecture: all
|
||||||
Depends: nova-common (= ${binary:Version}), nginx, ${python:Depends}, ${misc:Depends}
|
Depends: nova-common (= ${binary:Version}), ${python:Depends}, ${misc:Depends}
|
||||||
Description: Nova Cloud Computing - object store
|
Description: Nova Cloud Computing - object store
|
||||||
Nova is a cloud computing fabric controller (the main part of an IaaS
|
Nova is a cloud computing fabric controller (the main part of an IaaS
|
||||||
system) built to match the popular AWS EC2 and S3 APIs. It is written in
|
system) built to match the popular AWS EC2 and S3 APIs. It is written in
|
||||||
|
|||||||
1
debian/nova-objectstore.install
vendored
1
debian/nova-objectstore.install
vendored
@@ -1,3 +1,2 @@
|
|||||||
bin/nova-objectstore usr/bin
|
bin/nova-objectstore usr/bin
|
||||||
debian/nova-objectstore.conf etc/nova
|
debian/nova-objectstore.conf etc/nova
|
||||||
debian/nova-objectstore.nginx.conf etc/nginx/sites-available
|
|
||||||
|
|||||||
1
debian/nova-objectstore.links
vendored
1
debian/nova-objectstore.links
vendored
@@ -1 +0,0 @@
|
|||||||
/etc/nginx/sites-available/nova-objectstore.nginx.conf /etc/nginx/sites-enabled/nova-objectstore.nginx.conf
|
|
||||||
17
debian/nova-objectstore.nginx.conf
vendored
17
debian/nova-objectstore.nginx.conf
vendored
@@ -1,17 +0,0 @@
|
|||||||
server {
|
|
||||||
listen 3333 default;
|
|
||||||
server_name localhost;
|
|
||||||
client_max_body_size 10m;
|
|
||||||
|
|
||||||
access_log /var/log/nginx/localhost.access.log;
|
|
||||||
|
|
||||||
location ~ /_images/.+ {
|
|
||||||
root /var/lib/nova/images;
|
|
||||||
rewrite ^/_images/(.*)$ /$1 break;
|
|
||||||
}
|
|
||||||
|
|
||||||
location / {
|
|
||||||
proxy_pass http://localhost:3334/;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -37,7 +37,6 @@ DEFINE_bool = DEFINE_bool
|
|||||||
# http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#39
|
# http://code.google.com/p/python-gflags/source/browse/trunk/gflags.py#39
|
||||||
|
|
||||||
DEFINE_integer('s3_port', 3333, 's3 port')
|
DEFINE_integer('s3_port', 3333, 's3 port')
|
||||||
DEFINE_integer('s3_internal_port', 3334, 's3 port')
|
|
||||||
DEFINE_string('s3_host', '127.0.0.1', 's3 host')
|
DEFINE_string('s3_host', '127.0.0.1', 's3 host')
|
||||||
#DEFINE_string('cloud_topic', 'cloud', 'the topic clouds listen on')
|
#DEFINE_string('cloud_topic', 'cloud', 'the topic clouds listen on')
|
||||||
DEFINE_string('compute_topic', 'compute', 'the topic compute nodes listen on')
|
DEFINE_string('compute_topic', 'compute', 'the topic compute nodes listen on')
|
||||||
|
|||||||
Reference in New Issue
Block a user