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
This commit is contained in:
Harald Jensås 2021-07-05 10:42:22 +02:00
parent e459428d9f
commit fcdbcf1fc8
2 changed files with 5 additions and 5 deletions

View File

@ -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.

View File

@ -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']):