pulp/pulp — pull request #1250 by jortel (2014-10-17 15:22:04+00:00)
Title: support shared storage in orphan purge.

The orphan purge needs to be updated to support a newly introduced pattern to support units with shared storage. In this context, this is NOT Amazon S3 or GridFS. This simply means that there are units with a storage_path that is a link to the same (file|directory). the directory structure looks like this:

-- content/
| -- shared/
| /
| -- content/
| -- links/
| --- linkA --> ../content
| --- linkB --> ../content

When all of the links are gone, the link target (../content) can be cleaned up.

The ostree units use the shared storage model like this:

-- content/
| -- shared/
| -- /
| -- content/
| -- links/
| --- snapshotA ---> /var/lib/pulp/content/shared//content/
| --- snapshotB ---> /var/lib/pulp/content/shared//content/

We need the orphan unit purge logic to support this as follows. When storage_path points into pulp's content/shared/* it needs to:

remove the link
remove the link target (content) when there are no more links.