Make update_agent in network_client use **kwargs
As we discussed on
http://lists.openstack.org/pipermail/openstack-dev/2015-July/068864.html
All http POST/PUT methods need to contain **kwargs as their arguments.
This patch makes update_agent of network_client use **kwargs.
Also added LP bug detail for add_router_to_l3_agent.
Partially implements blueprint consistent-service-method-names
Change-Id: Id5807a53b839f301517c18af76052a0752e39b9e
diff --git a/tempest/api/network/admin/test_agent_management.py b/tempest/api/network/admin/test_agent_management.py
index c5d0d57..64802aa 100644
--- a/tempest/api/network/admin/test_agent_management.py
+++ b/tempest/api/network/admin/test_agent_management.py
@@ -63,7 +63,7 @@
# one to avoid the negative effect.
agent_status = {'admin_state_up': origin_status}
body = self.admin_client.update_agent(agent_id=self.agent['id'],
- agent_info=agent_status)
+ agent=agent_status)
updated_status = body['agent']['admin_state_up']
self.assertEqual(origin_status, updated_status)
@@ -73,7 +73,7 @@
description = 'description for update agent.'
agent_description = {'description': description}
body = self.admin_client.update_agent(agent_id=self.agent['id'],
- agent_info=agent_description)
+ agent=agent_description)
self.addCleanup(self._restore_agent)
updated_description = body['agent']['description']
self.assertEqual(updated_description, description)
@@ -84,4 +84,4 @@
description = self.agent['description'] or ''
origin_agent = {'description': description}
self.admin_client.update_agent(agent_id=self.agent['id'],
- agent_info=origin_agent)
+ agent=origin_agent)
diff --git a/tempest/services/network/json/network_client.py b/tempest/services/network/json/network_client.py
index 08316be..4afa8ab 100644
--- a/tempest/services/network/json/network_client.py
+++ b/tempest/services/network/json/network_client.py
@@ -257,15 +257,18 @@
uri = '/ports?device_id=%s' % uuid
return self.list_resources(uri)
- def update_agent(self, agent_id, agent_info):
+ def update_agent(self, agent_id, **kwargs):
"""Update agent
:param agent_info: Agent update information.
E.g {"admin_state_up": True}
"""
+ # TODO(piyush): Current api-site doesn't contain this API description.
+ # After fixing the api-site, we need to fix here also for putting the
+ # link to api-site.
+ # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1526673
uri = '/agents/%s' % agent_id
- agent = {"agent": agent_info}
- return self.update_resource(uri, agent)
+ return self.update_resource(uri, kwargs)
def show_agent(self, agent_id, **fields):
uri = '/agents/%s' % agent_id
@@ -287,6 +290,7 @@
# TODO(piyush): Current api-site doesn't contain this API description.
# After fixing the api-site, we need to fix here also for putting the
# link to api-site.
+ # LP: https://bugs.launchpad.net/openstack-api-site/+bug/1526670
uri = '/agents/%s/l3-routers' % agent_id
return self.create_resource(uri, kwargs)