Project

General

Profile

Actions

Bug #5982

closed

In API/rules include/exclude is ordered for target parameter

Added by François ARMAND over 7 years ago. Updated over 7 years ago.

Status:
Released
Priority:
1
Category:
API
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:

Description

In the rule API (update, creation), include and exclude are ordered for the target parameter, so that:

"targets": [ {
  "exclude": {"or": ["policyServer:root"] },
  "include": {"or": ["group:foo"]}
}]

Leads to error:

"errorDetails": "Could not create Rule 60214a59-8d07-4446-9db1-36feb5342f3f cause is: JObject(List(JField(exclude,JObject(List(JField(or,JArray(List(JString(policyServer:root))))))), JField(include,JObject(List(JField(or,JArray(List(JString(group:foo))))))))) is not a valid rule target."

But:

"targets": [ {
  "include": {"or": ["group:foo"]},
  "exclude": {"or": ["policyServer:root"] }
}]

Works fine. But JSON fields are not sorted.


Subtasks 1 (0 open1 closed)

Bug #5988: Error with only "and" target since #5982ReleasedNicolas CHARLES2014-12-11Actions
Actions #1

Updated by François ARMAND over 7 years ago

  • Status changed from New to Pending technical review
  • Assignee changed from François ARMAND to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/rudder/pull/717
Actions #2

Updated by François ARMAND over 7 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #4

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 2.10.9 to 2.10.10
Actions #5

Updated by Vincent MEMBRÉ over 7 years ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 2.10.10 and 2.11.7, which were these days.

Actions

Also available in: Atom PDF