summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
Diffstat (limited to 'nova')
-rw-r--r--nova/api/ec2/cloud.py2
-rw-r--r--nova/boto_extensions.py40
-rw-r--r--nova/compute/api.py6
3 files changed, 4 insertions, 44 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 17b9a14fb..b426710bc 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -500,7 +500,7 @@ class CloudController(object):
def get_ajax_console(self, context, instance_id, **kwargs):
ec2_id = instance_id[0]
- internal_id = ec2_id_to_internal_id(ec2_id)
+ internal_id = ec2_id_to_id(ec2_id)
return self.compute_api.get_ajax_console(context, internal_id)
def describe_volumes(self, context, volume_id=None, **kwargs):
diff --git a/nova/boto_extensions.py b/nova/boto_extensions.py
deleted file mode 100644
index 6d55b8012..000000000
--- a/nova/boto_extensions.py
+++ /dev/null
@@ -1,40 +0,0 @@
-import base64
-import boto
-from boto.ec2.connection import EC2Connection
-
-class AjaxConsole:
- def __init__(self, parent=None):
- self.parent = parent
- self.instance_id = None
- self.url = None
-
- def startElement(self, name, attrs, connection):
- return None
-
- def endElement(self, name, value, connection):
- if name == 'instanceId':
- self.instance_id = value
- elif name == 'url':
- self.url = value
- else:
- setattr(self, name, value)
-
-class NovaEC2Connection(EC2Connection):
- def get_ajax_console(self, instance_id):
- """
- Retrieves a console connection for the specified instance.
-
- :type instance_id: string
- :param instance_id: The instance ID of a running instance on the cloud.
-
- :rtype: :class:`AjaxConsole`
- """
- params = {}
- self.build_list_params(params, [instance_id], 'InstanceId')
- return self.get_object('GetAjaxConsole', params, AjaxConsole)
- pass
-
-def override_connect_ec2(aws_access_key_id=None, aws_secret_access_key=None, **kwargs):
- return NovaEC2Connection(aws_access_key_id, aws_secret_access_key, **kwargs)
-
-boto.connect_ec2 = override_connect_ec2
diff --git a/nova/compute/api.py b/nova/compute/api.py
index adf4dbe43..4d25bd705 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -416,13 +416,13 @@ class API(base.Base):
def get_ajax_console(self, context, instance_id):
"""Get a url to an AJAX Console"""
- instance_ref = db.instance_get_by_internal_id(context, instance_id)
+ instance = self.get(context, instance_id)
output = rpc.call(context,
'%s.%s' % (FLAGS.compute_topic,
- instance_ref['host']),
+ instance['host']),
{'method': 'get_ajax_console',
- 'args': {'instance_id': instance_ref['id']}})
+ 'args': {'instance_id': instance['id']}})
rpc.cast(context, '%s' % FLAGS.ajax_console_proxy_topic,
{'method': 'authorize_ajax_console',