<s> """<STR_LIT>""" <EOL> import os <EOL> import sys <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> from oslo_reports import guru_meditation_report as gmr <EOL> from nova . console import websocketproxy <EOL> from nova import version <EOL> CONF = cfg . CONF <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_LIT:key>' , '<STR_LIT>' ) <EOL> CONF . import_opt ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> def exit_with_error ( msg , errno = - <NUM_LIT:1> ) : <EOL> sys . stderr . write ( msg + '<STR_LIT:\n>' ) <EOL> sys . exit ( errno ) <EOL> def proxy ( host , port ) : <EOL> if CONF . ssl_only and not os . path . exists ( CONF . cert ) : <EOL> exit_with_error ( "<STR_LIT>" % CONF . cert ) <EOL> if CONF . web and not os . path . exists ( CONF . web ) : <EOL> exit_with_error ( "<STR_LIT>" % CONF . web ) <EOL> logging . setup ( CONF , "<STR_LIT>" ) <EOL> gmr . TextGuruMeditation . setup_autorun ( version ) <EOL> websocketproxy . NovaWebSocketProxy ( <EOL> listen_host = host , <EOL> listen_port = port , <EOL> source_is_ipv6 = CONF . source_is_ipv6 , <EOL> verbose = CONF . verbose , <EOL> cert = CONF . cert , <EOL> key = CONF . key , <EOL> ssl_only = CONF . ssl_only , <EOL> daemon = CONF . daemon , <EOL> record = CONF . record , <EOL> traffic = CONF . verbose and not CONF . daemon , <EOL> web = CONF . web , <EOL> file_only = True , <EOL> RequestHandlerClass = websocketproxy . NovaProxyRequestHandler <EOL> ) . start_server ( ) </s>
