From 641ab43e3ee8445e1492e4d2aefb01a5a39c3f96 Mon Sep 17 00:00:00 2001 From: Vladyslav Drok Date: Tue, 26 Jul 2016 18:00:02 +0300 Subject: [PATCH] Change comment regarding network_interface In order to be able to unittest older API versions without changing tests that do node post, let's only add network_interface field to the return value of node_post_data if it was explicitly requested. Change-Id: I6de525040ee83011d3ebaf3e6da714bd3cd30603 --- ironic/tests/unit/api/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ironic/tests/unit/api/utils.py b/ironic/tests/unit/api/utils.py index 2b10351719..c63ff08076 100644 --- a/ironic/tests/unit/api/utils.py +++ b/ironic/tests/unit/api/utils.py @@ -94,7 +94,9 @@ def node_post_data(**kw): node.pop('conductor_affinity') node.pop('chassis_id') node.pop('tags') - # TODO(vdrok): Remove popping network_interface when it's exposed in API + # NOTE(vdrok): network_interface was introduced in API version 1.20, return + # it only if it was explicitly requested, so that tests using older API + # versions don't fail if 'network_interface' not in kw: node.pop('network_interface') internal = node_controller.NodePatchType.internal_attrs()