¡@

Home 

OpenStack Study: novncproxy.py

OpenStack Index

**** CubicPower OpenStack Study ****

def main():

    # Setup flags

    CONF.set_default('web', '/usr/share/novnc')

    config.parse_args(sys.argv)

    if CONF.ssl_only and not os.path.exists(CONF.cert):

        print("SSL only and %s not found" % CONF.cert)

        return(-1)

    # Check to see if novnc html/js/css files are present

    if not os.path.exists(CONF.web):

        print("Can not find novnc html/js/css files at %s." % CONF.web)

        return(-1)

    gmr.TextGuruMeditation.setup_autorun(version)

    # Create and start the NovaWebSockets proxy

    server = websocketproxy.NovaWebSocketProxy(

                                   listen_host=CONF.novncproxy_host,

                                   listen_port=CONF.novncproxy_port,

                                   source_is_ipv6=CONF.source_is_ipv6,

                                   verbose=CONF.verbose,

                                   cert=CONF.cert,

                                   key=CONF.key,

                                   ssl_only=CONF.ssl_only,

                                   daemon=CONF.daemon,

                                   record=CONF.record,

                                   web=CONF.web,

                                   file_only=True,

                                   no_parent=True,

                                   target_host='ignore',

                                   target_port='ignore',

                                   wrap_mode='exit',

                                   wrap_cmd=None)

    server.start_server()