deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH] Fix redirection to root_url/change drivers/provider via HTML UI
Date Mon, 11 Jun 2012 07:58:12 GMT
On 11/06/12 10:51, Michal Fojtik wrote:
> On 06/11/12, marios@redhat.com wrote:
>> From: marios <marios@redhat.com>
> 
> ACK. Although this change was not needed for me and the 'config' variable
> was exported successfully. I'll need to investigate this issue in future.
> 

OK - since this was reported by QE and I was able to reproduce it
perhaps we need a JIRA to track? May be a versioning issue (gems,
ruby?). I'll push this for now.

marios

>   -- Michal
> 
>>
>>
>> Signed-off-by: marios <marios@redhat.com>
>> ---
>>  server/lib/deltacloud/server.rb |   12 ++++++------
>>  1 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
>> index cdb7150..32acb38 100644
>> --- a/server/lib/deltacloud/server.rb
>> +++ b/server/lib/deltacloud/server.rb
>> @@ -44,7 +44,7 @@ module Deltacloud
>>  
>>      set :config, Deltacloud[:deltacloud]
>>  
>> -    get config.root_url + '/?' do
>> +    get Deltacloud.config[:deltacloud].root_url + '/?' do
>>        if params[:force_auth]
>>          return [401, 'Authentication failed'] unless driver.valid_credentials?(credentials)
>>        end
>> @@ -55,20 +55,20 @@ module Deltacloud
>>        end
>>      end
>>  
>> -    post config.root_url + '/?' do
>> +    post Deltacloud.config[:deltacloud].root_url + '/?' do
>>        param_driver, param_provider = params["driver"], params["provider"]
>>        if param_driver
>> -        redirect "#{config.root_url}\;driver=#{param_driver}", 301
>> +        redirect "#{Deltacloud.config[:deltacloud].root_url}\;driver=#{param_driver}",
301
>>        elsif param_provider && param_provider != "default"
>>  #FIXME NEEDS A BETTER WAY OF GRABBING CURRENT DRIVER FROM MATRIX PARAMS...
>>          current_matrix_driver = env["HTTP_REFERER"].match(/\;(driver)=(\w*).*$/i)
>>          if current_matrix_driver
>> -          redirect "#{config.root_url}\;driver=#{$2}\;provider=#{param_provider}",
301
>> +          redirect "#{Deltacloud.config[:deltacloud].root_url}\;driver=#{$2}\;provider=#{param_provider}",
301
>>          else
>> -          redirect "#{config.root_url}\;provider=#{param_provider}", 301
>> +          redirect "#{Deltacloud.config[:deltacloud].root_url}\;provider=#{param_provider}",
301
>>          end
>>        else
>> -        redirect "#{config.root_url}", 301
>> +        redirect "#{Deltacloud.config[:deltacloud].root_url}", 301
>>        end
>>      end
>>  
>> -- 
>> 1.7.6.5
>>
> 


Mime
View raw message