From a8b805d3a3106486ad663ab2b1c6be6525465c0b Mon Sep 17 00:00:00 2001 From: He Jie Xu Date: Tue, 24 Jun 2014 11:20:26 +0800 Subject: Fix agent_id with string type in API samples files for os-agents v2 The agent_id should be integer for agent create and index. But in the api sample file it is string type. It's because the api sample tests provide agent_id with string type in fake data. This patch correct the api sample files and tests. For agent update, it use agent_id that passed from url, make the response use string for agent_id. We can't fix this problem for back-compatibility. This will be fix in the future after v3 API expose by micro-version Change-Id: I262b4b26c94dba003e80bda2f38d2e985ef9f220 Partial-Bug: #1333494 --- nova/api/openstack/compute/contrib/agents.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nova/api/openstack/compute') diff --git a/nova/api/openstack/compute/contrib/agents.py b/nova/api/openstack/compute/contrib/agents.py index ff1ea1e054..9c7c7bdca6 100644 --- a/nova/api/openstack/compute/contrib/agents.py +++ b/nova/api/openstack/compute/contrib/agents.py @@ -112,6 +112,11 @@ class AgentController(object): except exception.AgentBuildNotFound as ex: raise webob.exc.HTTPNotFound(explanation=ex.format_message()) + # NOTE(alex_xu): The agent_id should be integer that consistent with + # create/index actions. But parameter 'id' is string type that parsed + # from url. This is a bug, but because back-compatibility, it can't be + # fixed for v2 API. This will be fixed after v3 API feature exposed by + # micro-version in the future. lp bug #1333494 return {"agent": {'agent_id': id, 'version': version, 'url': url, 'md5hash': md5hash}} -- cgit v1.2.1