From 0d2daa262a785ebe8664c7cc761f79ef8b4a2661 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Sun, 16 Jul 2017 09:17:35 -0400 Subject: [PATCH] XenAPI: Fix ValueError in test_slave_asks_master_to_add_slave_to_pool Change If9e8dd5cc2634168910d5f9f8d9302aeefa16097 in oslo.serialization will raise a ValueError when it can't convert something to a primitive, which in this case is the Aggregate object used in this test. Given the add_to_aggregate method doesn't even serialize the Aggregate object passed in, I'm not sure how this was working before, but the fix is to just not try and expect add_aggregate_host RPC API is called with a serialized Aggregate object. Change-Id: I139533dfd94a1aa7a00a6220a4411bebe1c9e88b Related-Bug: #1593641 --- nova/tests/unit/virt/xenapi/test_xenapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nova/tests/unit/virt/xenapi/test_xenapi.py b/nova/tests/unit/virt/xenapi/test_xenapi.py index 7c77ab3745ef..e0cf2dea0797 100644 --- a/nova/tests/unit/virt/xenapi/test_xenapi.py +++ b/nova/tests/unit/virt/xenapi/test_xenapi.py @@ -3401,7 +3401,7 @@ class HypervisorPoolTestCase(test.NoDBTestCase): self.assertIn( (slave.compute_rpcapi.add_aggregate_host, - "CONTEXT", "slave", jsonutils.to_primitive(self.fake_aggregate), + "CONTEXT", "slave", self.fake_aggregate, "master", "SLAVE_INFO"), slave.compute_rpcapi._mock_calls)