incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r1156395 - /incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
Date Wed, 10 Aug 2011 22:42:23 GMT
Author: lutter
Date: Wed Aug 10 22:42:23 2011
New Revision: 1156395

URL: http://svn.apache.org/viewvc?rev=1156395&view=rev
Log:
rhevm driver (convert_state): upcase the state

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb?rev=1156395&r1=1156394&r2=1156395&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/drivers/rhevm/rhevm_driver.rb Wed Aug
10 22:42:23 2011
@@ -263,7 +263,10 @@ class RHEVMDriver < Deltacloud::BaseDriv
   # IMAGE_LOCKED or POWERING_DOWN
   #
   def convert_state(state)
-    case state
+    unless state.respond_to?(:upcase)
+      raise "State #{state.inspect} is not a string"
+    end
+    case state.upcase
     when 'WAIT_FOR_LAUNCH', 'REBOOT_IN_PROGRESS', 'SAVING_STATE',
       'RESTORING_STATE', 'POWERING_DOWN', 'POWERING_UP', 'IMAGE_LOCKED', 'SAVING_STATE' then
       'PENDING'
@@ -272,7 +275,7 @@ class RHEVMDriver < Deltacloud::BaseDriv
     when 'UP', 'MIGRATING_TO', 'MIGRATING_FROM'
       'RUNNING'
     else
-      raise "Unexpected state #{state}"
+      raise "Unexpected state '#{state}'"
     end
   end
 



Mime
View raw message