diff options
-rw-r--r-- | nova/scheduler/manager.py | 5 | ||||
-rw-r--r-- | nova/scheduler/rpcapi.py | 5 | ||||
-rw-r--r-- | nova/tests/scheduler/test_rpcapi.py | 7 |
3 files changed, 16 insertions, 1 deletions
diff --git a/nova/scheduler/manager.py b/nova/scheduler/manager.py index 535eb7797..f3eb6e2e8 100644 --- a/nova/scheduler/manager.py +++ b/nova/scheduler/manager.py @@ -54,7 +54,7 @@ QUOTAS = quota.QUOTAS class SchedulerManager(manager.Manager): """Chooses a host to run instances on.""" - RPC_API_VERSION = '2.4' + RPC_API_VERSION = '2.5' def __init__(self, scheduler_driver=None, *args, **kwargs): if not scheduler_driver: @@ -263,3 +263,6 @@ class SchedulerManager(manager.Manager): @manager.periodic_task def _expire_reservations(self, context): QUOTAS.expire(context) + + def get_backdoor_port(self, context): + return self.backdoor_port diff --git a/nova/scheduler/rpcapi.py b/nova/scheduler/rpcapi.py index 4bc6e0e45..6ae4adcae 100644 --- a/nova/scheduler/rpcapi.py +++ b/nova/scheduler/rpcapi.py @@ -49,6 +49,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): 2.3 - Remove create_volume() 2.4 - Change update_service_capabilities() - accepts a list of capabilities + 2.5 - Add get_backdoor_port() ''' # @@ -106,3 +107,7 @@ class SchedulerAPI(nova.openstack.common.rpc.proxy.RpcProxy): service_name=service_name, host=host, capabilities=capabilities), version='2.4') + + def get_backdoor_port(self, context, host): + return self.call(context, self.make_msg('get_backdoor_port'), + version='2.5') diff --git a/nova/tests/scheduler/test_rpcapi.py b/nova/tests/scheduler/test_rpcapi.py index b1174559a..da7652a50 100644 --- a/nova/tests/scheduler/test_rpcapi.py +++ b/nova/tests/scheduler/test_rpcapi.py @@ -37,6 +37,9 @@ class SchedulerRpcAPITestCase(test.TestCase): expected_msg = rpcapi.make_msg(method, **kwargs) expected_msg['version'] = expected_version + if method == 'get_backdoor_port': + del expected_msg['args']['host'] + self.fake_args = None self.fake_kwargs = None @@ -84,3 +87,7 @@ class SchedulerRpcAPITestCase(test.TestCase): rpc_method='fanout_cast', service_name='fake_name', host='fake_host', capabilities='fake_capabilities', version='2.4') + + def test_get_backdoor_port(self): + self._test_scheduler_api('get_backdoor_port', rpc_method='call', + host='fake_host', version='2.5') |