anchor.diff:    generateProfileManifest = serviceActivationMapping: targetName: infrastructure: targetProperty:
       if serviceActivationMapping == [] then []
       else
  -      if (head serviceActivationMapping).target == getAttr targetProperty (getAttr targetName infrastructure)
  +      let
  +        target = getAttr targetName infrastructure;
  +      in
  +      if (head serviceActivationMapping).target == getTargetProperty targetProperty target
         then [ (head serviceActivationMapping).service (head serviceActivationMapping).type ] ++ (generateProfileManifest (tail serviceActivationMapping) targetName infrastructure targetProperty)
         else generateProfileManifest (tail serviceActivationMapping) targetName infrastructure targetProperty
     ;
  
positive.code:   queryServicesByTargetName = serviceActivationMapping: targetName: infrastructure: targetProperty:
      if serviceActivationMapping == [] then []
      else
        if (head serviceActivationMapping).target == getAttr targetProperty (getAttr targetName infrastructure)
        then [ (head serviceActivationMapping).service ] ++ (queryServicesByTargetName (tail serviceActivationMapping) targetName infrastructure targetProperty)
        else queryServicesByTargetName (tail serviceActivationMapping) targetName infrastructure targetProperty
    ;
  
negative.code:     ) (attrNames distribution))
    ;
    
    /**
     * Fetches the key value that is used to refer to a target machine.
     * If a target defines a 'targetProperty' then the corresponding attribute
     * is used. If no targetProperty is provided by the target, then the global
     * targetProperty is used.
     *
     * Parameters:
     * targetProperty: Attribute from the infrastructure model that is used to connect to the Disnix interface
     * target: An attributeset containing properties of a target machine
     *
     * Returns
     * A string containing the key value
     */
    getTargetProperty = targetProperty: target:
      if target ? targetProperty then getAttr (target.targetProperty) target
      else getAttr targetProperty target
  