Index: src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php =================================================================== --- src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php +++ src/applications/drydock/blueprint/DrydockAmazonEC2HostBlueprintImplementation.php @@ -60,6 +60,14 @@ $lease->getAttributes(), $this->getDetail('attributes')); + if ($lease->getAttribute('platform') === null) { + // If the platform is not specified, then we can lease against any + // existing host resource (this is used for working copies where + // the platform is not known ahead of time, but the target host + // resource ID is). + $platform_match = true; + } + if ($platform_match && $custom_match) { $this->log(pht( 'This blueprint can allocate the specified lease.')); @@ -974,6 +982,10 @@ } $lease->setAttribute('path', $full_path); + if ($lease->getAttribute('platform') === null) { + // If the lease didn't specify a platform, set it now. + $lease->setAttribute('platform', $platform); + } $this->log(pht( 'Lease %d acquired on resource %d',