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
This commit is contained in:
Vladyslav Drok 2016-07-26 18:00:02 +03:00
parent 79439274bb
commit 641ab43e3e

View File

@ -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()