CLI event filters give extraneous results with more than one filter
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MAAS |
Fix Released
|
Medium
|
Unassigned |
Bug Description
If I execute the following command:
maas $PROFILE events query level=AUDIT owner=$USERNAME hostname=$HOSTNAME
(e.g, maas $PROFILE events query level=AUDIT owner=admin hostname=
MAAS presents extraneous records which do no correspond to the combination of the filters, e.g.:
{
"count": 14,
"events": [
{
"node": "e86c7h",
"id": 12729,
"type": "Node",
},
{
"node": "e86c7h",
"id": 12725,
"type": "Node",
},
{
"node": null,
"id": 12502,
"type": "Node",
},
{
"node": null,
"id": 12497,
"type": "Node",
},
{
"node": null,
"id": 12493,
"type": "Node",
},
{
"node": null,
"id": 12486,
"type": "Node",
},
{
"node": null,
"id": 12479,
"type": "Node",
},
{
"node": null,
"id": 134,
"type": "Node",
},
{
"node": null,
"id": 130,
"type": "Node",
},
{
"node": null,
"id": 18,
"type": "Settings",
},
{
"node": null,
"id": 14,
"type": "Settings",
},
{
"node": null,
"id": 13,
"type": "Settings",
},
{
"node": null,
"id": 12,
"type": "Settings",
},
{
"node": null,
"id": 11,
"type": "Authorisation",
}
],
"next_uri": "/MAAS/
"prev_uri": "/MAAS/
}
All of the records containing the hostname and owner are displayed correctly, but MAAS continues displaying records until all records with owner=$USERNAME (e.g., owner=admin) have been displayed.
It's expected that if a user specifies two filter parameters, only those records matching both filters would be displayed.
Related branches
- Alberto Donato (community): Approve
-
Diff: 46 lines (+23/-1)2 files modifiedsrc/maasserver/api/events.py (+1/-1)
src/maasserver/api/tests/test_events.py (+22/-0)
Changed in maas: | |
status: | New → Triaged |
Changed in maas: | |
status: | Triaged → Fix Committed |
Changed in maas: | |
milestone: | 3.3.0 → 3.3.0-beta1 |
Changed in maas: | |
status: | Fix Committed → Fix Released |
It looks like "unknown" value matches with any value specified in the filter. We will have a closer look.