summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-03-24 17:04:55 -0700
committerAnthony Young <sleepsonthefloor@gmail.com>2011-03-24 17:04:55 -0700
commitf2f08a5b0309876bb312c9124e75bd89331c4816 (patch)
treed934cad3a2f1201df6e778fabaf586b5fe7e698e
parent1ca149a00788253a025b02602c5f0d317d6652a9 (diff)
downloadnova-f2f08a5b0309876bb312c9124e75bd89331c4816.tar.gz
nova-f2f08a5b0309876bb312c9124e75bd89331c4816.tar.xz
nova-f2f08a5b0309876bb312c9124e75bd89331c4816.zip
make everything work with trunk again
-rw-r--r--nova/api/ec2/cloud.py2
-rw-r--r--nova/virt/libvirt_conn.py2
-rw-r--r--nova/vnc/auth.py20
3 files changed, 13 insertions, 11 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 6b08f98c2..eb0428c2c 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -538,7 +538,7 @@ class CloudController(object):
def get_vnc_console(self, context, instance_id, **kwargs):
ec2_id = instance_id
- instance_id = ec2_id_to_id(ec2_id)
+ instance_id = ec2utils.ec2_id_to_id(ec2_id)
return self.compute_api.get_vnc_console(context,
instance_id=instance_id)
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index 9cd0e8ac9..41adbfe27 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -626,7 +626,7 @@ class LibvirtConnection(driver.ComputeDriver):
return {'token': token, 'host': host, 'port': port}
- _image_sems = {} # FIXME: why is this here? (anthony)
+ _image_sems = {} # FIXME: why is this here? (anthony)
@staticmethod
def _cache_image(fn, target, fname, cow=False, *args, **kwargs):
diff --git a/nova/vnc/auth.py b/nova/vnc/auth.py
index 1c6a638fc..4161f3666 100644
--- a/nova/vnc/auth.py
+++ b/nova/vnc/auth.py
@@ -69,12 +69,14 @@ class NovaAuthMiddleware(object):
middleware = self
middleware.tokens = {}
- def callback(self, data, message):
- if data['method'] == 'authorize_vnc_console':
- token = data['args']['token']
+ class Proxy():
+ @staticmethod
+ def authorize_vnc_console(context, **kwargs):
+ data = kwargs
+ token = kwargs['token']
LOG.audit(_("Received Token: %s)"), token)
middleware.tokens[token] = \
- {'args': data['args'], 'last_activity_at': time.time()}
+ {'args': kwargs, 'last_activity_at': time.time()}
def delete_expired_tokens():
now = time.time()
@@ -88,12 +90,12 @@ class NovaAuthMiddleware(object):
del middleware.tokens[k]
conn = rpc.Connection.instance(new=True)
- consumer = rpc.TopicConsumer(
- connection=conn,
- topic=FLAGS.vnc_console_proxy_topic)
- consumer.register_callback(callback)
+ consumer = rpc.TopicAdapterConsumer(
+ connection=conn,
+ proxy=Proxy,
+ topic=FLAGS.vnc_console_proxy_topic)
- utils.LoopingCall(consumer.fetch, auto_ack=True,
+ utils.LoopingCall(consumer.fetch,
enable_callbacks=True).start(0.1)
utils.LoopingCall(delete_expired_tokens).start(1)