From: Martyn Taylor mtaylor@redhat.com
--- src/app/util/condormatic.rb | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb index 107ad6e..8f17073 100644 --- a/src/app/util/condormatic.rb +++ b/src/app/util/condormatic.rb @@ -51,9 +51,16 @@ def match(instance) provider_images.select {|pi| pi.provider == account.provider}.each do |pi| if not instance.frontend_realm.nil? instance.frontend_realm.realm_backend_targets.each do |brealm_target| + + # If this backend target is a provider, add all the realms for this provider to the possible matches if brealm_target.target_provider == account.provider - possibles << Possible.new(pool_family, account, hwp, pi, - brealm_target.target_realm) + brealm_target.target_provider.realms.each do |realm| + possibles << Possible.new(pool_family, account, hwp, pi, realm) + end + + # If this target is a realm then add this realm to the possible matches + elsif not brealm_target.target_realm.nil? && brealm_target.target_realm.provider == accounts.provider + possibles << Possible.new(pool_family, account, hwp, pi, brealm_target.target_realm) end end else