Fix attach_interfaces tests
Tempest's interfaces_client was not calling Nova "os-interface" API correctly.
The POST parameter interfaceAttachment was ill formed.
Change-Id: I3db0381d48919c62f3f3c6d60fc14cf4dee9c4a3
Closes-Bug: #1271642
diff --git a/tempest/services/compute/json/interfaces_client.py b/tempest/services/compute/json/interfaces_client.py
index 06e6476..cbbbee0 100644
--- a/tempest/services/compute/json/interfaces_client.py
+++ b/tempest/services/compute/json/interfaces_client.py
@@ -36,11 +36,12 @@
fixed_ip=None):
post_body = dict(interfaceAttachment=dict())
if port_id:
- post_body['port_id'] = port_id
+ post_body['interfaceAttachment']['port_id'] = port_id
if network_id:
- post_body['net_id'] = network_id
+ post_body['interfaceAttachment']['net_id'] = network_id
if fixed_ip:
- post_body['fixed_ips'] = [dict(ip_address=fixed_ip)]
+ fip = dict(ip_address=fixed_ip)
+ post_body['interfaceAttachment']['fixed_ips'] = [fip]
post_body = json.dumps(post_body)
resp, body = self.post('servers/%s/os-interface' % server,
headers=self.headers,