Browse Source

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
changes/42/799442/3
Harald Jensås 3 months ago
parent
commit
fcdbcf1fc8
  1. 4
      releasenotes/notes/nodes-json-mac-field-no-longer-valid-6ed035c442c4fc68.yaml
  2. 6
      tripleo_common/utils/nodes.py

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

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

Loading…
Cancel
Save