diff options
| author | Ryan Lane <laner@controller> | 2010-12-22 23:47:31 +0000 |
|---|---|---|
| committer | Ryan Lane <laner@controller> | 2010-12-22 23:47:31 +0000 |
| commit | 5012ccb22724c2f7fb0fcdcb7b146d5d5e61337d (patch) | |
| tree | 3d44d084647c86c41cc189d3a8bf8bcdedba3ef7 /bin/nova-api | |
| parent | e893be0a8d32cf1eb2c91187b81a6febf90e5b7c (diff) | |
| parent | 3f37287c1adfe35756c58938ea8d826181bad2e2 (diff) | |
| download | nova-5012ccb22724c2f7fb0fcdcb7b146d5d5e61337d.tar.gz nova-5012ccb22724c2f7fb0fcdcb7b146d5d5e61337d.tar.xz nova-5012ccb22724c2f7fb0fcdcb7b146d5d5e61337d.zip | |
Merge from trunk, and resolve conflict with nova/auth/ldapdriver.py
Diffstat (limited to 'bin/nova-api')
| -rwxr-xr-x | bin/nova-api | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/bin/nova-api b/bin/nova-api index a9c53dbcd..1c671201e 100755 --- a/bin/nova-api +++ b/bin/nova-api @@ -17,10 +17,10 @@ # 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 import sys @@ -32,9 +32,13 @@ possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')): sys.path.insert(0, possible_topdir) +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') @@ -43,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) |
