28
28
import nova .conf
29
29
from nova import context
30
30
from nova import exception
31
- from nova .i18n import _LI
32
31
from nova import objects
33
32
from nova import utils
34
33
from nova import version
@@ -82,13 +81,12 @@ def handshake(self, req, connect_info, sockets):
82
81
data += b
83
82
if data .find ("\r \n \r \n " ) != - 1 :
84
83
if not data .split ("\r \n " )[0 ].find ("200" ):
85
- LOG .info (_LI ("Error in handshake format: %s" ),
86
- data )
84
+ LOG .info ("Error in handshake format: %s" , data )
87
85
return
88
86
break
89
87
90
88
if not b or len (data ) > 4096 :
91
- LOG .info (_LI ( "Error in handshake: %s" ) , data )
89
+ LOG .info ("Error in handshake: %s" , data )
92
90
return
93
91
94
92
client = req .environ ['eventlet.input' ].get_socket ()
@@ -103,7 +101,7 @@ def proxy_connection(self, req, connect_info, start_response):
103
101
t0 .wait ()
104
102
105
103
if not sockets .get ('client' ) or not sockets .get ('server' ):
106
- LOG .info (_LI ( "Invalid request: %s" ) , req )
104
+ LOG .info ("Invalid request: %s" , req )
107
105
start_response ('400 Invalid Request' ,
108
106
[('content-type' , 'text/html' )])
109
107
return "Invalid Request"
@@ -123,10 +121,10 @@ def proxy_connection(self, req, connect_info, start_response):
123
121
def __call__ (self , environ , start_response ):
124
122
try :
125
123
req = webob .Request (environ )
126
- LOG .info (_LI ( "Request: %s" ) , req )
124
+ LOG .info ("Request: %s" , req )
127
125
token = req .params .get ('token' )
128
126
if not token :
129
- LOG .info (_LI ( "Request made with missing token: %s" ) , req )
127
+ LOG .info ("Request made with missing token: %s" , req )
130
128
start_response ('400 Invalid Request' ,
131
129
[('content-type' , 'text/html' )])
132
130
return "Invalid Request"
@@ -137,14 +135,14 @@ def __call__(self, environ, start_response):
137
135
connect_info = objects .ConsoleAuthToken .validate (
138
136
ctxt , token ).to_dict ()
139
137
except exception .InvalidToken :
140
- LOG .info (_LI ( "Request made with invalid token: %s" ) , req )
138
+ LOG .info ("Request made with invalid token: %s" , req )
141
139
start_response ('401 Not Authorized' ,
142
140
[('content-type' , 'text/html' )])
143
141
return "Not Authorized"
144
142
145
143
return self .proxy_connection (req , connect_info , start_response )
146
144
except Exception as e :
147
- LOG .info (_LI ( "Unexpected error: %s" ) , e )
145
+ LOG .info ("Unexpected error: %s" , e )
148
146
149
147
150
148
class SafeHttpProtocol (eventlet .wsgi .HttpProtocol ):
@@ -164,8 +162,8 @@ def finish(self):
164
162
165
163
166
164
def get_wsgi_server ():
167
- LOG .info (_LI ( "Starting nova-xvpvncproxy node (version %s)" ) ,
168
- version .version_string_with_package ())
165
+ LOG .info ("Starting nova-xvpvncproxy node (version %s)" ,
166
+ version .version_string_with_package ())
169
167
170
168
LOG .warning ('The nova-xvpvncproxy service is deprecated as it is Xen '
171
169
'specific and has effectively been replaced by noVNC '
0 commit comments