2011-01-05 14:16:14 -06:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
|
|
|
2012-08-16 13:34:17 -05:00
|
|
|
# Copyright (c) 2010 OpenStack, LLC.
|
2011-01-05 14:16:14 -06:00
|
|
|
# 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 Console Proxy."""
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
2012-10-15 01:40:25 +01:00
|
|
|
from nova import config
|
2012-11-17 22:50:17 +00:00
|
|
|
from nova.openstack.common import cfg
|
2012-06-28 15:59:23 -05:00
|
|
|
from nova.openstack.common import log as logging
|
2011-01-05 14:16:14 -06:00
|
|
|
from nova import service
|
|
|
|
|
2012-11-17 22:50:17 +00:00
|
|
|
CONF = cfg.CONF
|
2013-01-08 06:52:32 +00:00
|
|
|
CONF.import_opt('console_topic', 'nova.console.rpcapi')
|
2012-11-04 21:32:38 +00:00
|
|
|
|
2011-01-05 14:16:14 -06:00
|
|
|
if __name__ == '__main__':
|
2012-10-15 01:40:25 +01:00
|
|
|
config.parse_args(sys.argv)
|
2012-06-28 15:59:23 -05:00
|
|
|
logging.setup("nova")
|
2012-10-16 15:47:52 -06:00
|
|
|
server = service.Service.create(binary='nova-console',
|
2012-11-04 21:32:38 +00:00
|
|
|
topic=CONF.console_topic)
|
2011-08-18 10:55:39 -07:00
|
|
|
service.serve(server)
|
2011-01-05 14:16:14 -06:00
|
|
|
service.wait()
|