Our classad matching was using the realm from the provider classad even
if the user didn't specify it; it was just matching against the first
provider classad regardless of realm and using that.

This patch makes it so NULL is passed into the deltacloud gahp if no
realm is specified by the user, allowing any realm to be chosen.

Signed-off-by: Ian Main <im...@redhat.com>
---
 src/app/util/condormatic.rb |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/app/util/condormatic.rb b/src/app/util/condormatic.rb
index e766231..4e79670 100644
--- a/src/app/util/condormatic.rb
+++ b/src/app/util/condormatic.rb
@@ -36,8 +36,18 @@ def condormatic_instance_create(task)
     Rails.logger.info "universe = grid\n"
     pipe.puts "executable = #{job_name}\n"
     Rails.logger.info "executable = #{job_name}\n"
-    pipe.puts "grid_resource = dcloud $$(provider_url) $$(username) 
$$(password) $$(image_key) #{instance.name} $$(realm_key) 
$$(hardwareprofile_key)\n"
-    Rails.logger.info "grid_resource = dcloud $$(provider_url) $$(username) 
$$(password) $$(image_key) #{instance.name} $$(realm_key) 
$$(hardwareprofile_key)\n"
+
+    resource = "grid_resource = dcloud $$(provider_url) $$(username) 
$$(password)"
+    if realm != nil
+      resource += " $$(image_key)"
+    else
+      resource += " NULL"
+    end
+    resource += " #{instance.name} $$(realm_key) $$(hardwareprofile_key)\n"
+
+    pipe.puts resource
+    Rails.logger.info resource
+
     requirements = "requirements = hardwareprofile == 
\"#{instance.hardware_profile.id}\" && image == \"#{instance.image.id}\""
     requirements += " && realm == \"#{realm.name}\"" if realm != nil
     requirements += "\n"
-- 
1.7.1.1

_______________________________________________
deltacloud-devel mailing list
deltacloud-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to