summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorRussell Bryant <rbryant@redhat.com>2012-08-03 15:43:26 -0400
committerRussell Bryant <rbryant@redhat.com>2012-08-06 15:09:33 -0400
commitce2da5e52b743a15d87bab8b7546449ceb4e6871 (patch)
tree987d2a3901556ca62941ff47a60186d8db23c7af /nova
parentc9f15e3a51658c6b406521d87a95e94f25edf977 (diff)
downloadnova-ce2da5e52b743a15d87bab8b7546449ceb4e6871.tar.gz
nova-ce2da5e52b743a15d87bab8b7546449ceb4e6871.tar.xz
nova-ce2da5e52b743a15d87bab8b7546449ceb4e6871.zip
Remove topic from scheduler run_instance.
This argument to run_instance was unused, so just remove it. Change-Id: I42366514285a2355f647c776af140effc1618b7d
Diffstat (limited to 'nova')
-rw-r--r--nova/compute/api.py2
-rw-r--r--nova/compute/manager.py2
-rw-r--r--nova/scheduler/chance.py2
-rw-r--r--nova/scheduler/driver.py2
-rw-r--r--nova/scheduler/filter_scheduler.py2
-rw-r--r--nova/scheduler/manager.py8
-rw-r--r--nova/scheduler/rpcapi.py7
-rw-r--r--nova/tests/scheduler/test_chance_scheduler.py6
-rw-r--r--nova/tests/scheduler/test_filter_scheduler.py6
-rw-r--r--nova/tests/scheduler/test_rpcapi.py8
-rw-r--r--nova/tests/scheduler/test_scheduler.py6
11 files changed, 26 insertions, 25 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py
index 4f3b458c4..7ff66aa93 100644
--- a/nova/compute/api.py
+++ b/nova/compute/api.py
@@ -745,7 +745,7 @@ class API(base.Base):
}
return self.scheduler_rpcapi.run_instance(context,
- topic=FLAGS.compute_topic, request_spec=request_spec,
+ request_spec=request_spec,
admin_password=admin_password, injected_files=injected_files,
requested_networks=requested_networks, is_first_time=True,
filter_properties=filter_properties,
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index a8d325b4b..0f24a2546 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -598,7 +598,7 @@ class ComputeManager(manager.SchedulerDependentManager):
LOG.debug(_("Re-scheduling instance: attempt %d"),
retry['num_attempts'], instance_uuid=instance_uuid)
- self.scheduler_rpcapi.run_instance(context, FLAGS.compute_topic,
+ self.scheduler_rpcapi.run_instance(context,
request_spec, admin_password, injected_files,
requested_networks, is_first_time, filter_properties,
reservations=None, call=False)
diff --git a/nova/scheduler/chance.py b/nova/scheduler/chance.py
index f7427ea6e..d3378c38c 100644
--- a/nova/scheduler/chance.py
+++ b/nova/scheduler/chance.py
@@ -60,7 +60,7 @@ class ChanceScheduler(driver.Scheduler):
host = self._schedule(context, topic, None, filter_properties)
driver.cast_to_host(context, topic, host, method, **kwargs)
- def schedule_run_instance(self, context, topic, request_spec,
+ def schedule_run_instance(self, context, request_spec,
admin_password, injected_files,
requested_networks, is_first_time,
filter_properties, reservations):
diff --git a/nova/scheduler/driver.py b/nova/scheduler/driver.py
index e70776f53..36be81f48 100644
--- a/nova/scheduler/driver.py
+++ b/nova/scheduler/driver.py
@@ -192,7 +192,7 @@ class Scheduler(object):
msg = _("Driver must implement schedule_prep_resize")
raise NotImplementedError(msg)
- def schedule_run_instance(self, context, topic, request_spec,
+ def schedule_run_instance(self, context, request_spec,
admin_password, injected_files,
requested_networks, is_first_time,
filter_properties, reservations):
diff --git a/nova/scheduler/filter_scheduler.py b/nova/scheduler/filter_scheduler.py
index 4e4411c56..de44ace46 100644
--- a/nova/scheduler/filter_scheduler.py
+++ b/nova/scheduler/filter_scheduler.py
@@ -51,7 +51,7 @@ class FilterScheduler(driver.Scheduler):
msg = _("No host selection for %s defined.") % topic
raise exception.NoValidHost(reason=msg)
- def schedule_run_instance(self, context, topic, request_spec,
+ def schedule_run_instance(self, context, request_spec,
admin_password, injected_files,
requested_networks, is_first_time,
filter_properties, reservations):
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py
index b1befc55e..ad3441593 100644
--- a/nova/scheduler/manager.py
+++ b/nova/scheduler/manager.py
@@ -53,7 +53,7 @@ QUOTAS = quota.QUOTAS
class SchedulerManager(manager.Manager):
"""Chooses a host to run instances on."""
- RPC_API_VERSION = '1.1'
+ RPC_API_VERSION = '1.2'
def __init__(self, scheduler_driver=None, *args, **kwargs):
if not scheduler_driver:
@@ -115,14 +115,14 @@ class SchedulerManager(manager.Manager):
{'vm_state': vm_states.ERROR},
context, ex, request_spec)
- def run_instance(self, context, topic, request_spec, admin_password,
+ def run_instance(self, context, request_spec, admin_password,
injected_files, requested_networks, is_first_time,
- filter_properties, reservations):
+ filter_properties, reservations, topic=None):
"""Tries to call schedule_run_instance on the driver.
Sets instance vm_state to ERROR on exceptions
"""
try:
- result = self.driver.schedule_run_instance(context, topic,
+ result = self.driver.schedule_run_instance(context,
request_spec, admin_password, injected_files,
requested_networks, is_first_time, filter_properties,
reservations)
diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py
index 60de98c91..a553b202c 100644
--- a/nova/scheduler/rpcapi.py
+++ b/nova/scheduler/rpcapi.py
@@ -36,6 +36,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
- remove instance_uuid, add instance
- remove instance_type_id, add instance_type
- remove topic, it was unused
+ 1.2 - Remove topic from run_instance, it was unused
'''
BASE_RPC_API_VERSION = '1.0'
@@ -44,17 +45,17 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy):
super(SchedulerAPI, self).__init__(topic=FLAGS.scheduler_topic,
default_version=self.BASE_RPC_API_VERSION)
- def run_instance(self, ctxt, topic, request_spec, admin_password,
+ def run_instance(self, ctxt, request_spec, admin_password,
injected_files, requested_networks, is_first_time,
filter_properties, reservations, call=True):
rpc_method = self.call if call else self.cast
- return rpc_method(ctxt, self.make_msg('run_instance', topic=topic,
+ return rpc_method(ctxt, self.make_msg('run_instance',
request_spec=request_spec, admin_password=admin_password,
injected_files=injected_files,
requested_networks=requested_networks,
is_first_time=is_first_time,
filter_properties=filter_properties,
- reservations=reservations))
+ reservations=reservations), version='1.2')
def prep_resize(self, ctxt, instance, instance_type, image,
update_db, request_spec, filter_properties):
diff --git a/nova/tests/scheduler/test_chance_scheduler.py b/nova/tests/scheduler/test_chance_scheduler.py
index 0a27375df..e7f06e4e1 100644
--- a/nova/tests/scheduler/test_chance_scheduler.py
+++ b/nova/tests/scheduler/test_chance_scheduler.py
@@ -118,7 +118,7 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
driver.encode_instance(instance2).AndReturn(instance2_encoded)
self.mox.ReplayAll()
- result = self.driver.schedule_run_instance(ctxt, None, request_spec,
+ result = self.driver.schedule_run_instance(ctxt, request_spec,
None, None, None, None, {}, reservations)
expected = [instance1_encoded, instance2_encoded]
self.assertEqual(result, expected)
@@ -178,7 +178,7 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
driver.encode_instance(instance2).AndReturn(instance2)
self.mox.ReplayAll()
- self.driver.schedule_run_instance(ctxt, '', request_spec, None, None,
+ self.driver.schedule_run_instance(ctxt, request_spec, None, None,
None, None, {}, None)
def test_basic_schedule_run_instance_no_hosts(self):
@@ -200,7 +200,7 @@ class ChanceSchedulerTestCase(test_scheduler.SchedulerTestCase):
self.mox.ReplayAll()
self.assertRaises(exception.NoValidHost,
- self.driver.schedule_run_instance, ctxt, '', request_spec,
+ self.driver.schedule_run_instance, ctxt, request_spec,
None, None, None, None, {}, None)
def test_basic_schedule_fallback(self):
diff --git a/nova/tests/scheduler/test_filter_scheduler.py b/nova/tests/scheduler/test_filter_scheduler.py
index 4de0bb645..acfb82b18 100644
--- a/nova/tests/scheduler/test_filter_scheduler.py
+++ b/nova/tests/scheduler/test_filter_scheduler.py
@@ -50,7 +50,7 @@ class FilterSchedulerTestCase(test_scheduler.SchedulerTestCase):
'ephemeral_gb': 0},
'instance_properties': {'project_id': 1}}
self.assertRaises(exception.NoValidHost, sched.schedule_run_instance,
- fake_context, '', request_spec, None, None, None,
+ fake_context, request_spec, None, None, None,
None, {}, None)
def test_run_instance_non_admin(self):
@@ -72,7 +72,7 @@ class FilterSchedulerTestCase(test_scheduler.SchedulerTestCase):
request_spec = {'instance_type': {'memory_mb': 1, 'local_gb': 1},
'instance_properties': {'project_id': 1}}
self.assertRaises(exception.NoValidHost, sched.schedule_run_instance,
- fake_context, '', request_spec, None, None, None,
+ fake_context, request_spec, None, None, None,
None, {}, None)
self.assertTrue(self.was_admin)
@@ -127,7 +127,7 @@ class FilterSchedulerTestCase(test_scheduler.SchedulerTestCase):
{}, None, None, None, None).AndReturn(instance2)
self.mox.ReplayAll()
- self.driver.schedule_run_instance(context_fake, '', request_spec,
+ self.driver.schedule_run_instance(context_fake, request_spec,
None, None, None, None, {}, None)
def test_schedule_happy_day(self):
diff --git a/nova/tests/scheduler/test_rpcapi.py b/nova/tests/scheduler/test_rpcapi.py
index c881bc306..20874c365 100644
--- a/nova/tests/scheduler/test_rpcapi.py
+++ b/nova/tests/scheduler/test_rpcapi.py
@@ -66,19 +66,19 @@ class SchedulerRpcAPITestCase(test.TestCase):
def test_run_instance_call(self):
self._test_scheduler_api('run_instance', rpc_method='call',
- topic='fake_topic', request_spec='fake_request_spec',
+ request_spec='fake_request_spec',
admin_password='pw', injected_files='fake_injected_files',
requested_networks='fake_requested_networks',
is_first_time=True, filter_properties='fake_filter_properties',
- reservations=None)
+ reservations=None, version='1.2')
def test_run_instance_cast(self):
self._test_scheduler_api('run_instance', rpc_method='cast',
- topic='fake_topic', request_spec='fake_request_spec',
+ request_spec='fake_request_spec',
admin_password='pw', injected_files='fake_injected_files',
requested_networks='fake_requested_networks',
is_first_time=True, filter_properties='fake_filter_properties',
- reservations=None)
+ reservations=None, version='1.2')
def test_prep_resize(self):
self._test_scheduler_api('prep_resize', rpc_method='cast',
diff --git a/nova/tests/scheduler/test_scheduler.py b/nova/tests/scheduler/test_scheduler.py
index baf6b3f64..0c416dc72 100644
--- a/nova/tests/scheduler/test_scheduler.py
+++ b/nova/tests/scheduler/test_scheduler.py
@@ -221,14 +221,14 @@ class SchedulerManagerTestCase(test.TestCase):
request_spec = {'instance_properties':
{'uuid': fake_instance_uuid}}
- self.manager.driver.schedule_run_instance(self.context, self.topic,
+ self.manager.driver.schedule_run_instance(self.context,
request_spec, None, None, None, None, {}, None).AndRaise(
exception.NoValidHost(reason=""))
db.instance_update_and_get_original(self.context, fake_instance_uuid,
{"vm_state": vm_states.ERROR}).AndReturn((inst, inst))
self.mox.ReplayAll()
- self.manager.run_instance(self.context, self.topic, request_spec,
+ self.manager.run_instance(self.context, request_spec,
None, None, None, None, {}, None)
def test_prep_resize_no_valid_host_back_in_active_state(self):
@@ -771,7 +771,7 @@ class SchedulerDriverBaseTestCase(SchedulerTestCase):
self.assertRaises(NotImplementedError,
self.driver.schedule_run_instance,
- self.context, '', fake_request_spec, None, None, None,
+ self.context, fake_request_spec, None, None, None,
None, None, None)
def test_unimplemented_schedule_prep_resize(self):