Bug 947144 - [RFE] Consider support for validating unit profiles
Summary: [RFE] Consider support for validating unit profiles
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: consumers
Version: Master
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-01 18:16 UTC by Jay Dobies
Modified: 2015-02-28 23:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-19 01:04:01 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 178 0 None None None Never

Description Jay Dobies 2013-04-01 18:16:11 UTC
We may need to add something to the Profiler API that verifies a unit profile before Pulp saves it on the consumer. This originally came from another bug filed by Katello (that bug had two separate issues, this is tracking the validation portion):


In addition, no validation appears to be performed on the profile, so i could pass something like as the unit profile:


{
"_id": {
    "$oid": "51360d559c60ed183200005e"
},
"_ns": "consumer_unit_profiles",
"consumer_id": "22eaa87c-76a1-4d5a-af34-f6a167e3bc44",
"content_type": "rpm",
"id": "51360d559c60ed183200005e",
"profile": [ {"version": "1.0", "name": "zsh"}  ]
}


which is accepted perfectly fine (even though its invalid).  However very bad things happen, as you cannot delete the consumer after you do this, or retrieve the unit profile.  

For example, here's a partial traceback I get when trying to delete:

  File "/usr/lib64/python2.6/site-packages/pymongo/database.py", line 663, in dereference
    return self[dbref.collection].find_one({"_id": dbref.id})
  File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 520, in find_one
    for result in self.find(spec_or_id, *args, **kwargs).limit(-1):
  File "/usr/lib64/python2.6/site-packages/pymongo/cursor.py", line 703, in next
    if len(self.__data) or self._refresh():
  File "/usr/lib64/python2.6/site-packages/pymongo/cursor.py", line 666, in _refresh
    self.__uuid_subtype))
  File "/usr/lib64/python2.6/site-packages/pymongo/cursor.py", line 628, in __send_message
    self.__tz_aware)
  File "/usr/lib64/python2.6/site-packages/pymongo/helpers.py", line 101, in _unpack_response
    error_object["$err"])
pymongo.errors.OperationFailure: database error: invalid operator: $oid

Comment 1 Brian Bouterse 2015-02-19 01:04:01 UTC
Moved to https://pulp.plan.io/issues/178


Note You need to log in before you can comment on or make changes to this bug.