You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by ma...@redhat.com on 2012/05/24 17:48:25 UTC
[PATCH] Reinstate the post /api call for changing provider in HTML UI /api when available (originally addressed in JIRA DTACLOUD-105 (EC2 Regions))
From: marios <ma...@redhat.com>
Signed-off-by: marios <ma...@redhat.com>
---
server/lib/deltacloud/server.rb | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
index fced64b..0df76e9 100644
--- a/server/lib/deltacloud/server.rb
+++ b/server/lib/deltacloud/server.rb
@@ -53,6 +53,15 @@ module Deltacloud
end
end
+ post Deltacloud[:root_url] + '/?' do
+ provider = params["provider"]
+ if provider && provider != "default"
+ redirect "#{Deltacloud[:root_url]}\;provider=#{params['provider']}", 301
+ else
+ redirect settings.root_url, 301
+ end
+ end
+
end
end
--
1.7.6.5
Re: [PATCH] Reinstate the post /api call for changing provider in
HTML UI /api when available (originally addressed in JIRA DTACLOUD-105 (EC2
Regions))
Posted by Michal Fojtik <mf...@redhat.com>.
On 05/24/12, marios@redhat.com wrote:
ACK. Good catch!
-- Michal
> From: marios <ma...@redhat.com>
>
>
> Signed-off-by: marios <ma...@redhat.com>
> ---
> server/lib/deltacloud/server.rb | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
> index fced64b..0df76e9 100644
> --- a/server/lib/deltacloud/server.rb
> +++ b/server/lib/deltacloud/server.rb
> @@ -53,6 +53,15 @@ module Deltacloud
> end
> end
>
> + post Deltacloud[:root_url] + '/?' do
> + provider = params["provider"]
> + if provider && provider != "default"
> + redirect "#{Deltacloud[:root_url]}\;provider=#{params['provider']}", 301
> + else
> + redirect settings.root_url, 301
> + end
> + end
> +
> end
> end
>
> --
> 1.7.6.5
>
--
Michal Fojtik
Sr. Software Engineer, Deltacloud API (http://deltacloud.org)
Re: [PATCH] Reinstate the post /api call for changing provider in
HTML UI /api when available (originally addressed in JIRA DTACLOUD-105 (EC2
Regions))
Posted by David Lutterkort <lu...@redhat.com>.
On Thu, 2012-05-24 at 18:48 +0300, marios@redhat.com wrote:
> From: marios <ma...@redhat.com>
>
>
> Signed-off-by: marios <ma...@redhat.com>
ACK; why can this only be used to set the provider ? Shouldn't we also
allow setting the driver through this call ?
Also: the commit message is too long (break it into multiple lines)
David
> ---
> server/lib/deltacloud/server.rb | 9 +++++++++
> 1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/server/lib/deltacloud/server.rb b/server/lib/deltacloud/server.rb
> index fced64b..0df76e9 100644
> --- a/server/lib/deltacloud/server.rb
> +++ b/server/lib/deltacloud/server.rb
> @@ -53,6 +53,15 @@ module Deltacloud
> end
> end
>
> + post Deltacloud[:root_url] + '/?' do
> + provider = params["provider"]
> + if provider && provider != "default"
> + redirect "#{Deltacloud[:root_url]}\;provider=#{params['provider']}", 301
> + else
> + redirect settings.root_url, 301
> + end
> + end
> +
> end
> end
>