[2.x] maas cli allocate interfaces=<label>:ip=<ADDRESS> errors with Unknown interfaces constraint
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
High
|
Newell Jensen | ||
2.2 |
Fix Released
|
High
|
Newell Jensen |
Bug Description
The help lists 'ip' as an interfaces constraint key but the cli actually does not accept it:
$ maas vmaas machines allocate interfaces=
{"interfaces": ["Unknown interfaces constraint: 'ip"]}
:param interfaces: A labeled constraint map associating constraint
labels with interface properties that should be matched. Returned
nodes must have one or more interface matching the specified
constraints. The labeled constraint map must be in the format:
``<
Each key can be one of the following:
- id: Matches an interface with the specific id
- fabric: Matches an interface attached to the specified fabric.
- fabric_class: Matches an interface attached to a fabric
with the specified class.
- ip: Matches an interface with the specified IP address
assigned to it.
- mode: Matches an interface with the specified mode. (Currently,
the only supported mode is "unconfigured".)
- name: Matches an interface with the specified name.
(For example, "eth0".)
- hostname: Matches an interface attached to the node with
the specified hostname.
- subnet: Matches an interface attached to the specified subnet.
- space: Matches an interface attached to the specified space.
- subnet_cidr: Matches an interface attached to the specified
subnet CIDR. (For example, "192.168.0.0/24".)
- type: Matches an interface of the specified type. (Valid
types: "physical", "vlan", "bond", "bridge", or "unknown".)
- vlan: Matches an interface on the specified VLAN.
- vid: Matches an interface on a VLAN with the specified VID.
- tag: Matches an interface tagged with the specified tag.
:type interfaces: unicode
Related branches
- Newell Jensen (community): Approve
-
Diff: 48 lines (+19/-8)1 file modifiedsrc/maasserver/node_constraint_filter_forms.py (+19/-8)
- Lee Trager (community): Approve
-
Diff: 48 lines (+19/-8)1 file modifiedsrc/maasserver/node_constraint_filter_forms.py (+19/-8)
summary: |
- maas cli allocate interfaces=<label>:ip=<ADDRESS> errors with Unknown - interfaces constraint + [2.x] maas cli allocate interfaces=<label>:ip=<ADDRESS> errors with + Unknown interfaces constraint |
Changed in maas: | |
assignee: | nobody → Newell Jensen (newell-jensen) |
Changed in maas: | |
status: | Triaged → In Progress |
Changed in maas: | |
status: | In Progress → Fix Committed |
Changed in maas: | |
milestone: | 2.3.0 → 2.3.0alpha1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
Hm, this looks like a bug in the AcquireNodeForm (node_constrain t_filter_ forms.py) . It does some additional validation of each constraint, checking it against this set of valid constraints here:
NETWORKING_ CONSTRAINT_ NAMES = { fabric_ class', subnet_ cidr',
'space',
'not_space',
'fabric_class',
'not_
'subnet_cidr',
'not_
'vid',
'not_vid',
'fabric',
'not_fabric',
'subnet',
'not_subnet',
'mode',
'tag',
'not_tag',
}
Adding "ip" and "not_ip" to this list might fix the issue. I'll have to test it out more.