MAAS acquire interfaces argument should AND key-value pairs for the same label

Bug #1517097 reported by Dimiter Naydenov on 2015-11-17
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Critical
Mike Pontillo
1.9
High
Mike Pontillo
Trunk
Critical
Mike Pontillo

Bug Description

As discussed with Mike the key-value pairs part of the same label passed as the "interfaces" argument when acquiring a node, should be AND-ed together, rather than OR-ed,

Example: interfaces=label1:space=foo,mode=unconfigured,vid=42;label2:space=bar,not_fabric_class=slow
I'd expect to get a node with (at least) 2 NICs, first one on space "foo" and having "link_up" but no address, while the second one on space "bar" and not on a fabric with class "slow".

Right now (1.9.0~rc1+bzr4496-0ubuntu1~trusty1) that example yields nodes which have first NIC on *either* space "foo" *or* is unconfigured, and second one on space bar or on a fabric without class slow, which is a bit surprising.

One change in maasserver/utils/orm.py as suggested by Mike did the trick: in parse_item_operation(), changing the last "else:" clause to "op = AND", rather than "op = OR".

Related branches

Changed in maas:
status: New → Triaged
importance: Undecided → Critical
milestone: none → 1.9.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers