diff options
| author | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-09-20 15:36:45 -0400 |
|---|---|---|
| committer | Michael Gundlach <michael.gundlach@rackspace.com> | 2010-09-20 15:36:45 -0400 |
| commit | 8fb32a956490f9de623fad12d9b2b1f08f88511a (patch) | |
| tree | b5db72db732eb8cc390cbb4ec545df9e7cffa79a /bin | |
| parent | 8e304fe0bf69fe5f6bad2fa3d5a71a93cb0612e8 (diff) | |
| parent | cda407fa0eff533e3aae7d3bf7276e0013a8a13d (diff) | |
Merge from trunk
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-scheduler | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/bin/nova-scheduler b/bin/nova-scheduler new file mode 100755 index 000000000..38a8f213f --- /dev/null +++ b/bin/nova-scheduler @@ -0,0 +1,43 @@ +#!/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. + +""" + Twistd daemon for the nova scheduler nodes. +""" + +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 service +from nova import twistd + + +if __name__ == '__main__': + twistd.serve(__file__) + +if __name__ == '__builtin__': + application = service.Service.create() |
