[2.x] maas cli allocate interfaces=<label>:ip=<ADDRESS> errors with Unknown interfaces constraint

Bug #1700802 reported by John George
6
This bug affects 1 person
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=infra-1:ip=10.245.208.40
{"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:
    ``<label>:<key>=<value>[,<key2>=<value2>[,...]]``

    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

Tags: cdo-qa

Related branches

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Hm, this looks like a bug in the AcquireNodeForm (node_constraint_filter_forms.py). It does some additional validation of each constraint, checking it against this set of valid constraints here:

NETWORKING_CONSTRAINT_NAMES = {
    'space',
    'not_space',
    'fabric_class',
    'not_fabric_class',
    'subnet_cidr',
    'not_subnet_cidr',
    '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.

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
importance: Critical → High
milestone: none → 2.3.0
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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.