summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEwan Mellor <ewan.mellor@citrix.com>2010-07-24 02:49:20 +0100
committerEwan Mellor <ewan.mellor@citrix.com>2010-07-24 02:49:20 +0100
commiteffbd4b4c7077043c0ff2ddcb91607b4e79796f6 (patch)
treea9a4c628533c64211b349c9c3d713ddd9b113c8f /bin
parent1046fd21fad35fdb9922f667017937ec94774498 (diff)
parent809a1fe80b9922a36c64bce948588a5797cae87b (diff)
Merged with trunk, since a lot of useful things have gone in there recently.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-dhcpbridge (renamed from bin/dhcpleasor.py)29
-rwxr-xr-xbin/nova-objectstore25
2 files changed, 29 insertions, 25 deletions
diff --git a/bin/dhcpleasor.py b/bin/nova-dhcpbridge
index 4a3f374d5..cc827c50e 100755
--- a/bin/dhcpleasor.py
+++ b/bin/nova-dhcpbridge
@@ -18,23 +18,27 @@
# under the License.
"""
-dhcpleasor.py
+nova-dhcpbridge
Handle lease database updates from DHCP servers.
"""
-import sys
-import os
import logging
+import os
+import sys
+
+#TODO(joshua): there is concern that the user dnsmasq runs under will not
+# have nova in the path. This should be verified and if it is
+# not true the ugly line below can be removed
sys.path.append(os.path.abspath(os.path.join(__file__, "../../")))
-logging.debug(sys.path)
-import getopt
-from os import environ
-from nova import rpc
from nova import flags
+from nova import rpc
+from nova import utils
from nova.compute import linux_net
from nova.compute import network
+
+
FLAGS = flags.FLAGS
@@ -63,11 +67,12 @@ def init_leases(interface):
return res
-def main(argv=None):
- if argv is None:
- argv = sys.argv
- interface = environ.get('DNSMASQ_INTERFACE', 'br0')
- if int(environ.get('TESTING', '0')):
+def main():
+ flagfile = os.environ.get('FLAGFILE', FLAGS.dhcpbridge_flagfile)
+ utils.default_flagfile(flagfile)
+ argv = FLAGS(sys.argv)
+ interface = os.environ.get('DNSMASQ_INTERFACE', 'br0')
+ if int(os.environ.get('TESTING', '0')):
FLAGS.fake_rabbit = True
FLAGS.redis_db = 8
FLAGS.network_size = 32
diff --git a/bin/nova-objectstore b/bin/nova-objectstore
index 521f3d5d1..9385fd299 100755
--- a/bin/nova-objectstore
+++ b/bin/nova-objectstore
@@ -18,33 +18,32 @@
# under the License.
"""
- Tornado daemon for nova objectstore. Supports S3 API.
+ Twisted daemon for nova objectstore. Supports S3 API.
"""
import logging
-from tornado import httpserver
-from tornado import ioloop
from nova import flags
-from nova import server
from nova import utils
-from nova.auth import users
+from nova import twistd
from nova.objectstore import handler
FLAGS = flags.FLAGS
-def main(argv):
+def main():
# FIXME: if this log statement isn't here, no logging
# appears from other files and app won't start daemonized
- logging.debug('Started HTTP server on %s' % (FLAGS.s3_internal_port))
- app = handler.Application(users.UserManager())
- server = httpserver.HTTPServer(app)
- server.listen(FLAGS.s3_internal_port)
- ioloop.IOLoop.instance().start()
-
+ logging.debug('Started HTTP server on %s' % (FLAGS.s3_port))
+ app = handler.get_application()
+ print app
+ return app
+# NOTE(soren): Stolen from nova-compute
if __name__ == '__main__':
+ twistd.serve(__file__)
+
+if __name__ == '__builtin__':
utils.default_flagfile()
- server.serve('nova-objectstore', main)
+ application = main()