diff options
| author | Anthony Young <sleepsonthefloor@gmail.com> | 2011-03-24 17:44:27 -0700 |
|---|---|---|
| committer | Anthony Young <sleepsonthefloor@gmail.com> | 2011-03-24 17:44:27 -0700 |
| commit | 06c0eff8ec7eef33933da9bd8adbf7b70a977889 (patch) | |
| tree | 7eee64cc251058755d69ff5587768fcfc1ff821b | |
| parent | f2f08a5b0309876bb312c9124e75bd89331c4816 (diff) | |
| download | nova-06c0eff8ec7eef33933da9bd8adbf7b70a977889.tar.gz nova-06c0eff8ec7eef33933da9bd8adbf7b70a977889.tar.xz nova-06c0eff8ec7eef33933da9bd8adbf7b70a977889.zip | |
add hook for osapi
| -rw-r--r-- | nova/api/ec2/cloud.py | 1 | ||||
| -rw-r--r-- | nova/api/openstack/servers.py | 10 | ||||
| -rw-r--r-- | nova/vnc/auth.py | 4 |
3 files changed, 13 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index eb0428c2c..fa4624ff1 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -537,6 +537,7 @@ class CloudController(object): instance_id=instance_id) def get_vnc_console(self, context, instance_id, **kwargs): + """Returns vnc browser url to the dashboard.""" ec2_id = instance_id instance_id = ec2utils.ec2_id_to_id(ec2_id) return self.compute_api.get_vnc_console(context, diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 0dad46268..88cc790c1 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -482,6 +482,16 @@ class Controller(wsgi.Controller): return exc.HTTPAccepted() @scheduler_api.redirect_handler + def get_vnc_console(self, req, id): + """ Returns a url to an instance's ajaxterm console. """ + try: + self.compute_api.get_vnc_console(req.environ['nova.context'], + int(id)) + except exception.NotFound: + return faults.Fault(exc.HTTPNotFound()) + return exc.HTTPAccepted() + + @scheduler_api.redirect_handler def diagnostics(self, req, id): """Permit Admins to retrieve server diagnostics.""" ctxt = req.environ["nova.context"] diff --git a/nova/vnc/auth.py b/nova/vnc/auth.py index 4161f3666..dff9b376f 100644 --- a/nova/vnc/auth.py +++ b/nova/vnc/auth.py @@ -69,7 +69,7 @@ class NovaAuthMiddleware(object): middleware = self middleware.tokens = {} - class Proxy(): + class TopicProxy(): @staticmethod def authorize_vnc_console(context, **kwargs): data = kwargs @@ -92,7 +92,7 @@ class NovaAuthMiddleware(object): conn = rpc.Connection.instance(new=True) consumer = rpc.TopicAdapterConsumer( connection=conn, - proxy=Proxy, + proxy=TopicProxy, topic=FLAGS.vnc_console_proxy_topic) utils.LoopingCall(consumer.fetch, |
