incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Su <r...@redhat.com>
Subject [PATCH core] RHEV statuses will be lower cased in the next version
Date Thu, 22 Sep 2011 23:13:03 GMT
https://fedorahosted.org/rhevm-api/ticket/285

We should be case insensitive when using the status values.
---
 .../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


Mime
View raw message