From fcdbcf1fc8fef6f79dd9f42e1fbc9488ae69873e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Mon, 5 Jul 2021 10:42:22 +0200 Subject: [PATCH] Fix field validation typo s/macs/mac When removing support for the "mac" field in nodes json a check was added to raise an error when using the removed field. There was a typo in the field name. This fixes the typo, and the validation. Also fix the same typo in the release note. Change-Id: I518c854af6d8e2853fe661902b101a4cdecff2a7 Related-Bug: 1934133 --- ...des-json-mac-field-no-longer-valid-6ed035c442c4fc68.yaml | 4 ++-- tripleo_common/utils/nodes.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/releasenotes/notes/nodes-json-mac-field-no-longer-valid-6ed035c442c4fc68.yaml b/releasenotes/notes/nodes-json-mac-field-no-longer-valid-6ed035c442c4fc68.yaml index 7417bad56..7000e3052 100644 --- a/releasenotes/notes/nodes-json-mac-field-no-longer-valid-6ed035c442c4fc68.yaml +++ b/releasenotes/notes/nodes-json-mac-field-no-longer-valid-6ed035c442c4fc68.yaml @@ -1,7 +1,7 @@ --- other: - | - The compatibility wrapper for the deprecated field: ``macs`` in nodes JSON - *(instackenv.json)* has been removed. The ``macs`` field is no longer + The compatibility wrapper for the deprecated field: ``mac`` in nodes JSON + *(instackenv.json)* has been removed. The ``mac`` field is no longer supported as it was replaced by ``ports`` in the Stein release. diff --git a/tripleo_common/utils/nodes.py b/tripleo_common/utils/nodes.py index b8d3af6ef..237302af6 100644 --- a/tripleo_common/utils/nodes.py +++ b/tripleo_common/utils/nodes.py @@ -617,9 +617,9 @@ def validate_nodes(nodes_list): except exception.InvalidNode as exc: failures.append((index, exc)) - if node.get('macs'): - failures.append('The "macs" field is not longer supported. ' - 'Please use the "ports" field instead.') + if node.get('mac'): + failures.append((index, 'The "mac" field is not longer supported. ' + 'Please use the "ports" field instead.')) for port in node.get('ports', ()): if not netutils.is_valid_mac(port['address']):