Beispiel #1
0
for OpenStack Nova."""

import os
import sys

from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr

import nova.conf
from nova.conf import novnc
from nova.console import websocketproxy
from nova import version


CONF = nova.conf.CONF
novnc.register_cli_opts(CONF)


def exit_with_error(msg, errno=-1):
    sys.stderr.write(msg + '\n')
    sys.exit(errno)


def proxy(host, port):

    if CONF.ssl_only and not os.path.exists(CONF.cert):
        exit_with_error("SSL only and %s not found" % CONF.cert)

    # Check to see if tty html/js/css files are present
    if CONF.web and not os.path.exists(CONF.web):
        exit_with_error("Can not find html/js files at %s." % CONF.web)
import os
import sys

from oslo_log import log as logging
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts

import nova.conf
from nova.conf import novnc
from nova.console import websocketproxy
from nova import objects
from nova import version

CONF = nova.conf.CONF
novnc.register_cli_opts(CONF)
gmr_opts.set_defaults(CONF)
objects.register_all()


def exit_with_error(msg, errno=-1):
    sys.stderr.write(msg + '\n')
    sys.exit(errno)


def proxy(host, port, security_proxy=None):
    """:param host: local address to listen on
    :param port: local port to listen on
    :param security_proxy: instance of
        nova.console.securityproxy.base.SecurityProxy