If I'm reading this right, __parse_units is returning the mongo ID for the unit. This isn't the same as a unit key. A unit key is the logical unique identifier for the unit, which differs by type (Puppet: name, author, version; RPM: NEVRA+checksum). Looking at the profiler docstrings, there's a disconnect here. You're handing it the Mongo ID but it's expecting the unit key.

Also notice that get_unit_ids is deprecated in favor of the get_units method. If you actually want the unit keys, you'll need to use the latter anyway.