Merge pull request #214 from otherwiseguy/master
Update utils/nova-novncproxy to work with nova master branch
This commit is contained in:
commit
361cde7c96
|
@ -28,8 +28,8 @@ import sys
|
||||||
|
|
||||||
import wsproxy
|
import wsproxy
|
||||||
|
|
||||||
|
from nova import config
|
||||||
from nova import context
|
from nova import context
|
||||||
from nova import flags
|
|
||||||
from nova import utils
|
from nova import utils
|
||||||
from nova.openstack.common import cfg
|
from nova.openstack.common import cfg
|
||||||
from nova.openstack.common import rpc
|
from nova.openstack.common import rpc
|
||||||
|
@ -64,13 +64,13 @@ opts = [
|
||||||
default=6080,
|
default=6080,
|
||||||
help='Port on which to listen for incoming requests'),
|
help='Port on which to listen for incoming requests'),
|
||||||
]
|
]
|
||||||
FLAGS = flags.FLAGS
|
CONF = config.CONF
|
||||||
FLAGS.register_cli_opts(opts)
|
CONF.register_cli_opts(opts)
|
||||||
|
|
||||||
# As of nova commit 0b11668e64450039dc071a4a123abd02206f865f we must
|
# As of nova commit 0b11668e64450039dc071a4a123abd02206f865f we must
|
||||||
# manually register the rpc library
|
# manually register the rpc library
|
||||||
if hasattr(rpc, 'register_opts'):
|
if hasattr(rpc, 'register_opts'):
|
||||||
rpc.register_opts(FLAGS)
|
rpc.register_opts(CONF)
|
||||||
|
|
||||||
|
|
||||||
class NovaWebSocketProxy(wsproxy.WebSocketProxy):
|
class NovaWebSocketProxy(wsproxy.WebSocketProxy):
|
||||||
|
@ -128,23 +128,23 @@ class NovaWebSocketProxy(wsproxy.WebSocketProxy):
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if FLAGS.ssl_only and not os.path.exists(FLAGS.cert):
|
if CONF.ssl_only and not os.path.exists(CONF.cert):
|
||||||
parser.error("SSL only and %s not found" % FLAGS.cert)
|
parser.error("SSL only and %s not found" % CONF.cert)
|
||||||
|
|
||||||
# Setup flags
|
# Setup flags
|
||||||
flags.parse_args(sys.argv)
|
config.parse_args(sys.argv)
|
||||||
|
|
||||||
# Create and start the NovaWebSockets proxy
|
# Create and start the NovaWebSockets proxy
|
||||||
server = NovaWebSocketProxy(listen_host=FLAGS.novncproxy_host,
|
server = NovaWebSocketProxy(listen_host=CONF.novncproxy_host,
|
||||||
listen_port=FLAGS.novncproxy_port,
|
listen_port=CONF.novncproxy_port,
|
||||||
source_is_ipv6=FLAGS.source_is_ipv6,
|
source_is_ipv6=CONF.source_is_ipv6,
|
||||||
verbose=FLAGS.verbose,
|
verbose=CONF.verbose,
|
||||||
cert=FLAGS.cert,
|
cert=CONF.cert,
|
||||||
key=FLAGS.key,
|
key=CONF.key,
|
||||||
ssl_only=FLAGS.ssl_only,
|
ssl_only=CONF.ssl_only,
|
||||||
daemon=FLAGS.daemon,
|
daemon=CONF.daemon,
|
||||||
record=FLAGS.record,
|
record=CONF.record,
|
||||||
web=FLAGS.web,
|
web=CONF.web,
|
||||||
target_host='ignore',
|
target_host='ignore',
|
||||||
target_port='ignore',
|
target_port='ignore',
|
||||||
wrap_mode='exit',
|
wrap_mode='exit',
|
||||||
|
|
Loading…
Reference in New Issue