puppetlabs/puppetdb — pull request #279 by nicklewis (2012-09-12 23:52:30+00:00)
Title: Properly handle edges between exported resources

This was previously failing when an edge referred to an exported
resource which was also collected, because it was incorrectly assuming
collected resources would always be marked as NOT exported. However, in
the case of a node collecting a resource which it also exports, the
resource is still marked exported. In that case, it can be distinguished
from a purely exported resource by whether it's virtual. Purely virtual,
non-exported resources never appear in the catalog.

Virtual, exported resources are not collected, whereas non-virtual,
exported resources are. The former will eventually be removed from the
catalog before being sent to the agent, and thus aren't eligible for
participation in a relationship. We now check whether the resource is
virtual rather than exported, for correct behavior.