diff options
| author | Brian Elliott <bdelliott@gmail.com> | 2013-05-29 08:47:56 +0000 |
|---|---|---|
| committer | Brian Elliott <bdelliott@gmail.com> | 2013-05-29 08:47:56 +0000 |
| commit | b71c7c1c43087d4f1ba3ad102cc2a4dd3e305c2f (patch) | |
| tree | 827a30bda01ce3b6633a8a05a8f76668d213fc5c | |
| parent | 957bd5c780c83243c750c22925e8f61f683f2b03 (diff) | |
Fix msg version type sent to cells RPC API
Regression fix from 6b16c8731c44e4a6c80b803f3e8afdd88386d577, cannot
build instances through cells.
The RPC dispatcher dislikes floats for version numbers.
bug 1190371
Change-Id: I18994ce8a524f88910cfe37c9b302296ce30102f
| -rw-r--r-- | nova/cells/rpcapi.py | 2 | ||||
| -rw-r--r-- | nova/tests/cells/test_cells_rpcapi.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/nova/cells/rpcapi.py b/nova/cells/rpcapi.py index dd757c818..767498291 100644 --- a/nova/cells/rpcapi.py +++ b/nova/cells/rpcapi.py @@ -97,7 +97,7 @@ class CellsAPI(rpc_proxy.RpcProxy): build_inst_kwargs['image']) self.cast(ctxt, self.make_msg('build_instances', build_inst_kwargs=build_inst_kwargs), - version=1.8) + version='1.8') def instance_update_at_top(self, ctxt, instance): """Update instance at API level.""" diff --git a/nova/tests/cells/test_cells_rpcapi.py b/nova/tests/cells/test_cells_rpcapi.py index e44c0be4a..4d58bdb9e 100644 --- a/nova/tests/cells/test_cells_rpcapi.py +++ b/nova/tests/cells/test_cells_rpcapi.py @@ -55,6 +55,9 @@ class CellsAPITestCase(test.TestCase): self.assertEqual(self.fake_context, call_info['context']) self.assertEqual(self.fake_topic, call_info['topic']) self.assertEqual(method, call_info['msg']['method']) + msg_version = call_info['msg']['version'] + self.assertTrue(isinstance(msg_version, basestring), + "Message version %s is not a string" % msg_version) self.assertEqual(version, call_info['msg']['version']) self.assertEqual(args, call_info['msg']['args']) @@ -127,7 +130,7 @@ class CellsAPITestCase(test.TestCase): 'arg2': 2, 'arg3': 3}} self._check_result(call_info, 'build_instances', - expected_args, version=1.8) + expected_args, version='1.8') def test_get_capacities(self): capacity_info = {"capacity": "info"} |
