On 09/16/10 - 08:39:03AM, Ian Main wrote:
> 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 <[email protected]>
> ---
>  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)"

Hm, this patch claims to be about NULL realms, but you are setting image_key
here (or NULL), not realm_key.  Is this right?  Shouldn't you instead be
setting realm_key to NULL if no realm was found?

> +    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
> [email protected]
> https://fedorahosted.org/mailman/listinfo/deltacloud-devel

-- 
Chris Lalancette
_______________________________________________
deltacloud-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/deltacloud-devel

Reply via email to