summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjaypipes@gmail.com <>2010-12-17 11:10:11 -0500
committerjaypipes@gmail.com <>2010-12-17 11:10:11 -0500
commitafae367d63c6d38faa5d9be54725df29c2a5b903 (patch)
treee2282e9bbc6ef6d4c5f339a4fde38127a619f354 /bin
parentd283922defdda6ede5fa2e09656cd8d411a90096 (diff)
parentcd460a1f661eea7e050891f50a8218fdf24f2c6f (diff)
downloadnova-afae367d63c6d38faa5d9be54725df29c2a5b903.tar.gz
nova-afae367d63c6d38faa5d9be54725df29c2a5b903.tar.xz
nova-afae367d63c6d38faa5d9be54725df29c2a5b903.zip
Merge eventlet and resolve all conflicts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-api20
-rwxr-xr-xbin/nova-combined65
-rwxr-xr-xbin/nova-compute15
-rwxr-xr-xbin/nova-network15
-rwxr-xr-xbin/nova-scheduler15
-rwxr-xr-xbin/nova-volume15
6 files changed, 97 insertions, 48 deletions
diff --git a/bin/nova-api b/bin/nova-api
index 2ae6a099a..1c671201e 100755
--- a/bin/nova-api
+++ b/bin/nova-api
@@ -17,9 +17,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-"""
-Nova API daemon.
-"""
+
+"""Starter script for Nova API."""
import gettext
import os
@@ -35,9 +34,11 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
+from nova import api
from nova import flags
from nova import utils
-from nova import server
+from nova import wsgi
+
FLAGS = flags.FLAGS
flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
@@ -46,15 +47,10 @@ flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')
flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host')
-def main(_args):
- from nova import api
- from nova import wsgi
+if __name__ == '__main__':
+ utils.default_flagfile()
+ FLAGS(sys.argv)
server = wsgi.Server()
server.start(api.API('os'), FLAGS.osapi_port, host=FLAGS.osapi_host)
server.start(api.API('ec2'), FLAGS.ec2api_port, host=FLAGS.ec2api_host)
server.wait()
-
-
-if __name__ == '__main__':
- utils.default_flagfile()
- server.serve('nova-api', main)
diff --git a/bin/nova-combined b/bin/nova-combined
new file mode 100755
index 000000000..c6a04f7e9
--- /dev/null
+++ b/bin/nova-combined
@@ -0,0 +1,65 @@
+#!/usr/bin/env python
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2010 United States Government as represented by the
+# Administrator of the National Aeronautics and Space Administration.
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+"""Combined starter script for Nova services."""
+
+import eventlet
+eventlet.monkey_patch()
+
+import os
+import sys
+
+# If ../nova/__init__.py exists, add ../ to Python search path, so that
+# it will override what happens to be installed in /usr/(local/)lib/python...
+possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
+ os.pardir,
+ os.pardir))
+if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
+ sys.path.insert(0, possible_topdir)
+
+from nova import api
+from nova import flags
+from nova import service
+from nova import utils
+from nova import wsgi
+
+
+FLAGS = flags.FLAGS
+flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
+flags.DEFINE_string('osapi_host', '0.0.0.0', 'OpenStack API host')
+flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')
+flags.DEFINE_string('ec2api_host', '0.0.0.0', 'EC2 API host')
+
+
+if __name__ == '__main__':
+ utils.default_flagfile()
+ FLAGS(sys.argv)
+
+ compute = service.Service.create(binary='nova-compute')
+ network = service.Service.create(binary='nova-network')
+ volume = service.Service.create(binary='nova-volume')
+ scheduler = service.Service.create(binary='nova-scheduler')
+ #objectstore = service.Service.create(binary='nova-objectstore')
+
+ service.serve(compute, network, volume, scheduler)
+
+ server = wsgi.Server()
+ server.start(api.API('os'), FLAGS.osapi_port, host=FLAGS.osapi_host)
+ server.start(api.API('ec2'), FLAGS.ec2api_port, host=FLAGS.ec2api_host)
+ server.wait()
diff --git a/bin/nova-compute b/bin/nova-compute
index f57b68584..d2d352da2 100755
--- a/bin/nova-compute
+++ b/bin/nova-compute
@@ -17,9 +17,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
- Twistd daemon for the nova compute nodes.
-"""
+"""Starter script for Nova Compute."""
+
+import eventlet
+eventlet.monkey_patch()
import gettext
import os
@@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
from nova import service
-from nova import twistd
from nova import utils
-
if __name__ == '__main__':
utils.default_flagfile()
- twistd.serve(__file__)
-
-if __name__ == '__builtin__':
- application = service.Service.create() # pylint: disable=C0103
+ service.serve()
+ service.wait()
diff --git a/bin/nova-network b/bin/nova-network
index 86d04c723..0143846a7 100755
--- a/bin/nova-network
+++ b/bin/nova-network
@@ -17,9 +17,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
- Twistd daemon for the nova network nodes.
-"""
+"""Starter script for Nova Network."""
+
+import eventlet
+eventlet.monkey_patch()
import gettext
import os
@@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
from nova import service
-from nova import twistd
from nova import utils
-
if __name__ == '__main__':
utils.default_flagfile()
- twistd.serve(__file__)
-
-if __name__ == '__builtin__':
- application = service.Service.create() # pylint: disable-msg=C0103
+ service.serve()
+ service.wait()
diff --git a/bin/nova-scheduler b/bin/nova-scheduler
index 41e1937c1..f4c0eaed6 100755
--- a/bin/nova-scheduler
+++ b/bin/nova-scheduler
@@ -17,9 +17,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
- Twistd daemon for the nova scheduler nodes.
-"""
+"""Starter script for Nova Scheduler."""
+
+import eventlet
+eventlet.monkey_patch()
import gettext
import os
@@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
from nova import service
-from nova import twistd
from nova import utils
-
if __name__ == '__main__':
utils.default_flagfile()
- twistd.serve(__file__)
-
-if __name__ == '__builtin__':
- application = service.Service.create()
+ service.serve()
+ service.wait()
diff --git a/bin/nova-volume b/bin/nova-volume
index 4f2e96268..ad3ddc405 100755
--- a/bin/nova-volume
+++ b/bin/nova-volume
@@ -17,9 +17,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-"""
- Twistd daemon for the nova volume nodes.
-"""
+"""Starter script for Nova Volume."""
+
+import eventlet
+eventlet.monkey_patch()
import gettext
import os
@@ -36,13 +37,9 @@ if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
gettext.install('nova', unicode=1)
from nova import service
-from nova import twistd
from nova import utils
-
if __name__ == '__main__':
utils.default_flagfile()
- twistd.serve(__file__)
-
-if __name__ == '__builtin__':
- application = service.Service.create() # pylint: disable-msg=C0103
+ service.serve()
+ service.wait()