deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Fojtik <mfoj...@redhat.com>
Subject Re: [PATCH core] RHEV statuses will be lower cased in the next version
Date Fri, 23 Sep 2011 10:13:45 GMT
On Sep 23, 2011, at 1:13 AM, Richard Su wrote:

> https://fedorahosted.org/rhevm-api/ticket/285
> 
> We should be case insensitive when using the status values.
> --


ACK. Pushing.

 -- Michal

> -
> .../lib/deltacloud/drivers/rhevm/rhevm_client.rb   |    2 +-
> .../lib/deltacloud/drivers/rhevm/rhevm_driver.rb   |    2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
> index 8719c3d..79d4441 100644
> --- a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
> +++ b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb
> @@ -77,7 +77,7 @@ module RHEVM
>         RHEVM::client(@api_entrypoint)["/vms/%s" % id].delete(headers)
>       else
>         xml_response = Client::parse_response(RHEVM::client(@api_entrypoint)["/vms/%s/%s"
% [id, action]].post('<action/>', headers))
> -        return false if (xml_response/'action/status').first.text!="COMPLETE"
> +        return false if (xml_response/'action/status').first.text.strip.upcase!="COMPLETE"
>       end
>       return true
>     end
> diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> index 4405076..1fa6121 100644
> --- a/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> +++ b/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
> @@ -311,7 +311,7 @@ class RHEVMDriver < Deltacloud::BaseDriver
>     Realm.new(
>       :id => r.id,
>       :name => r.name,
> -      :state => dc.status == 'UP' ? 'AVAILABLE' : 'DOWN',
> +      :state => dc.status.strip.upcase == 'UP' ? 'AVAILABLE' : 'DOWN',
>       :limit => :unlimited
>     )
>   end
> -- 
> 1.7.6.2
> 

------------------------------------------------------
Michal Fojtik, mfojtik@redhat.com
Deltacloud API: http://deltacloud.org


Mime
View raw message