pulp/pulp_rpm — pull request #574 by beav (2014-10-09 13:52:36+00:00)
Title: 1150714 - delete all existing distribution_units before recreating

Distribution units have a unit key that contains the OS version, as read from
the treeinfo file.

When a new OS version comes out, a directory containing the most recent OS bits
will have a new treeinfo file with a different version and hence different unit
key. However, the old unit is not removed from the repo. This means there are
two distribution units for a single repo, which causes publish to fail.

This patch clears all existing distribution units before creating a new one.
This catches the case when the OS version in the treeinfo is bumped, and cases
when an older version of Pulp has already synced a second distribution unit
down and needs to tidy up the old one.