Merge lp:~vishvananda/nova/clean-compute into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Eric Day
Approved revision: 570
Merged at revision: 568
Proposed branch: lp:~vishvananda/nova/clean-compute
Merge into: lp:~hudson-openstack/nova/trunk
Prerequisite: lp:~vishvananda/nova/lp703012
Diff against target: 101 lines (+13/-28)
3 files modified
nova/api/ec2/cloud.py (+1/-17)
nova/compute/api.py (+10/-9)
nova/network/manager.py (+2/-2)
To merge this branch: bzr merge lp:~vishvananda/nova/clean-compute
Reviewer Review Type Date Requested Status
Eric Day (community) Approve
Devin Carlen (community) Approve
Review via email: mp+46315@code.launchpad.net

Description of the change

This branch fixes two outstanding bugs in compute. It also fixes a bad method signature in network and removes an unused method in cloud.

To post a comment you must log in.
Revision history for this message
Eric Day (eday) wrote :

ec2/cloud.py can have 'import rpc' removed now... \o/

otherwise, lgtm

review: Needs Fixing
Revision history for this message
Vish Ishaya (vishvananda) wrote :

done

lp:~vishvananda/nova/clean-compute updated
570. By Vish Ishaya

removed rpc in cloud

Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Eric Day (eday) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/api/ec2/cloud.py'
2--- nova/api/ec2/cloud.py 2011-01-14 07:49:41 +0000
3+++ nova/api/ec2/cloud.py 2011-01-14 19:38:41 +0000
4@@ -37,7 +37,6 @@
5 from nova import flags
6 from nova import log as logging
7 from nova import network
8-from nova import rpc
9 from nova import utils
10 from nova import volume
11 from nova.compute import instance_types
12@@ -130,15 +129,6 @@
13 result[key] = [line]
14 return result
15
16- def _trigger_refresh_security_group(self, context, security_group):
17- nodes = set([instance['host'] for instance in security_group.instances
18- if instance['host'] is not None])
19- for node in nodes:
20- rpc.cast(context,
21- '%s.%s' % (FLAGS.compute_topic, node),
22- {"method": "refresh_security_group",
23- "args": {"security_group_id": security_group.id}})
24-
25 def _get_availability_zone_by_host(self, context, host):
26 services = db.service_get_all_by_host(context, host)
27 if len(services) > 0:
28@@ -522,13 +512,7 @@
29 # instance_id is passed in as a list of instances
30 ec2_id = instance_id[0]
31 instance_id = ec2_id_to_id(ec2_id)
32- instance_ref = self.compute_api.get(context, instance_id)
33- output = rpc.call(context,
34- '%s.%s' % (FLAGS.compute_topic,
35- instance_ref['host']),
36- {"method": "get_console_output",
37- "args": {"instance_id": instance_ref['id']}})
38-
39+ output = self.compute_api.get_console_output(context, instance_id)
40 now = datetime.datetime.utcnow()
41 return {"InstanceId": ec2_id,
42 "Timestamp": now,
43
44=== modified file 'nova/compute/api.py'
45--- nova/compute/api.py 2011-01-14 17:24:45 +0000
46+++ nova/compute/api.py 2011-01-14 19:38:41 +0000
47@@ -21,6 +21,7 @@
48 """
49
50 import datetime
51+import re
52 import time
53
54 from nova import db
55@@ -397,23 +398,23 @@
56
57 def get_ajax_console(self, context, instance_id):
58 """Get a url to an AJAX Console"""
59-
60 instance = self.get(context, instance_id)
61-
62- output = rpc.call(context,
63- '%s.%s' % (FLAGS.compute_topic,
64- instance['host']),
65- {'method': 'get_ajax_console',
66- 'args': {'instance_id': instance['id']}})
67-
68+ output = self._call_compute_message('get_ajax_console',
69+ context,
70+ instance_id)
71 rpc.cast(context, '%s' % FLAGS.ajax_console_proxy_topic,
72 {'method': 'authorize_ajax_console',
73 'args': {'token': output['token'], 'host': output['host'],
74 'port': output['port']}})
75-
76 return {'url': '%s?token=%s' % (FLAGS.ajax_console_proxy_url,
77 output['token'])}
78
79+ def get_console_output(self, context, instance_id):
80+ """Get console output for an an instance"""
81+ return self._call_compute_message('get_console_output',
82+ context,
83+ instance_id)
84+
85 def lock(self, context, instance_id):
86 """lock the instance with instance_id"""
87 self._cast_compute_message('lock_instance', context, instance_id)
88
89=== modified file 'nova/network/manager.py'
90--- nova/network/manager.py 2011-01-12 08:47:54 +0000
91+++ nova/network/manager.py 2011-01-14 19:38:41 +0000
92@@ -239,8 +239,8 @@
93 """Get the network host for the current context."""
94 raise NotImplementedError()
95
96- def create_networks(self, context, num_networks, network_size, cidr_v6,
97- *args, **kwargs):
98+ def create_networks(self, context, cidr, num_networks, network_size,
99+ cidr_v6, *args, **kwargs):
100 """Create networks based on parameters."""
101 raise NotImplementedError()
102