deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Provaznik <jprov...@redhat.com>
Subject Re: [PATCH core] Openstack: Capture missing username as 401 error (DTACLOUD-330)
Date Mon, 01 Oct 2012 08:48:37 GMT
On 09/27/2012 02:15 PM, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mfojtik@redhat.com>
>
>
> Signed-off-by: Michal fojtik <mfojtik@redhat.com>
> ---
>   server/lib/deltacloud/drivers/openstack/openstack_driver.rb | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
> index 7e11258..86d6983 100644
> --- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
> +++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
> @@ -344,6 +344,9 @@ private
>           #for v2 authentication credentials.name == "username+tenant_name"
>           def new_client(credentials, type = :compute)
>             tokens = credentials.user.split("+")
> +          if credentials.user.empty?
> +            raise AuthenticationFailure.new(Exception.new("Error: you must supply the
username"))
> +          end
>             if (tokens.size != 2 && api_v2)
>               raise ValidationFailure.new(Exception.new("Error: expected \"username+tenantname\"
as username, you provided: #{credentials.user}"))
>             else
> @@ -505,6 +508,10 @@ private
>               status 400
>             end
>
> +          on /Must supply a :username/ do
> +            status 401
> +          end
> +
>             on /OpenStack::Exception::Authentication/ do
>               status 401
>             end
>
ACK

Mime
View raw message