summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-04 22:29:51 +0000
committerGerrit Code Review <review@openstack.org>2013-01-04 22:29:51 +0000
commit3e3111f137bc14bb4aa4522bd1fcabaac154ad17 (patch)
tree3e45a15c33641cceac609c8d137f2bb721e362d3 /bin
parent7efe647e365875dfe1fce03d9260c33349f1a75c (diff)
parentf9a868e86ce11f786538547c301b805bd68a1697 (diff)
downloadnova-3e3111f137bc14bb4aa4522bd1fcabaac154ad17.tar.gz
nova-3e3111f137bc14bb4aa4522bd1fcabaac154ad17.tar.xz
nova-3e3111f137bc14bb4aa4522bd1fcabaac154ad17.zip
Merge "Cells: Add the main code."
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-cells53
1 files changed, 53 insertions, 0 deletions
diff --git a/bin/nova-cells b/bin/nova-cells
new file mode 100755
index 000000000..a7e16ef53
--- /dev/null
+++ b/bin/nova-cells
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+#
+# Copyright (c) 2012 Rackspace Hosting
+# 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.
+
+"""Starter script for Nova Cells Service."""
+
+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 config
+from nova.openstack.common import cfg
+from nova.openstack.common import log as logging
+from nova import service
+from nova import utils
+
+CONF = cfg.CONF
+CONF.import_opt('topic', 'nova.cells.opts', group='cells')
+CONF.import_opt('manager', 'nova.cells.opts', group='cells')
+
+if __name__ == '__main__':
+ config.parse_args(sys.argv)
+ logging.setup('nova')
+ utils.monkey_patch()
+ server = service.Service.create(binary='nova-cells',
+ topic=CONF.cells.topic,
+ manager=CONF.cells.manager)
+ service.serve(server)
+ service.wait()