Project

Profile

Help

Issue #379

closed

No error when criteria inside request body lack the required type_ids (when unassociating this results in an empty repository)

Added by vincent.vandriessche@inuits.eu about 9 years ago. Updated almost 4 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.2
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description of problem:
While making a script to remove a set of packages, I encountered a stubborn error: When performing a POST request to "/pulp/api/v2/repositories/pulp2-cleanup-test/actions/unassociate/" with message body resembling following json:
{'criteria':
{'filters':
{'unit':
{'unit_id':
{'$in':
['5b1feecc-5b48-40a6-a890-39f0bf5b3960']
}
}
}
}
}
I ran into the fact that it did not remove the package with ID 5b1feecc-5b48-40a6-a890-39f0bf5b3960; It removed ALL of the repositories packages.

After some talking to the developers I was pointed out that without a type_id specified, the filters would all be dropped, what remains was an unassociate query without filtering: resulting in every package being removed.

This is how the packages are not all being dropped any longer:
{"criteria":
{"filters":
{"unit":
{"unit_id":
{"$in":
['5b1feecc-5b48-40a6-a890-39f0bf5b3960']
}
}
},
"type_ids":["rpm"]
}
}

I do think this should be properly documented or/and should throw an error instead of just wiping out repositories. ^^

Kind regards

Vincent

+ This bug was cloned from Bugzilla Bug #1021579 +

Also available in: Atom PDF