Use consoleauth rpcapi in nova-novncproxy.

The nova-novncproxy service was using rpc.call directly when it should
have been going through the rpcapi client proxy class.  This patch fixes
that.

Fix bug 1067858.

Change-Id: I626fb01ff61ff507520d528122358ef687d297b7
This commit is contained in:
Russell Bryant
2012-10-17 12:13:06 -07:00
parent a7cb04ab32
commit c94763edd6

View File

@@ -28,6 +28,7 @@ import sys
import websockify
from nova.consoleauth import rpcapi as consoleauth_rpcapi
from nova import context
from nova import flags
from nova.openstack.common import cfg
@@ -84,9 +85,8 @@ class NovaWebSocketProxy(websockify.WebSocketProxy):
cookie.load(self.headers.getheader('cookie'))
token = cookie['token'].value
ctxt = context.get_admin_context()
connect_info = rpc.call(ctxt, 'consoleauth',
{'method': 'check_token',
'args': {'token': token}})
rpcapi = consoleauth_rpcapi.ConsoleAuthAPI()
connect_info = rpcapi.check_token(ctxt, token=token)
if not connect_info:
LOG.audit("Invalid Token: %s", token)