From c8e87b3ee9477508756d6aa1480e254b832c4969 Mon Sep 17 00:00:00 2001
From: Jaime Melis <j.melis@fdi.ucm.es>
Date: Thu, 24 Feb 2011 12:51:33 +0100
Subject: [PATCH] Feature #495: Fixed mismatch in the name of the "saveas" and
 "livemigrate" action.

---
 src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb    | 4 ++--
 src/sunstone/test/examples/vm/{save_as.json => saveas.json} | 4 ++--
 src/sunstone/test/spec/vm_spec.rb                           | 6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)
 rename src/sunstone/test/examples/vm/{save_as.json => saveas.json} (78%)

diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb
index 3bdc57eeaa..92d152a9e9 100644
--- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb
+++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb
@@ -45,14 +45,14 @@ module OpenNebulaJSON
                 when "deploy"       then self.deploy(action_hash['params'])
                 when "finalize"     then self.finalize
                 when "hold"         then self.hold
-                when "live_migrate" then self.live_migrate(action_hash['params'])
+                when "livemigrate" then self.live_migrate(action_hash['params'])
                 when "migrate"      then self.migrate(action_hash['params'])
                 when "resume"       then self.resume
                 when "release"      then self.release
                 when "stop"         then self.stop
                 when "suspend"      then self.suspend
                 when "restart"      then self.restart
-                when "save_as"      then self.save_as(action_hash['params'])
+                when "saveas"      then self.save_as(action_hash['params'])
                 when "shutdown"     then self.shutdown
                 else
                     error_msg = "#{action_hash['perform']} action not " <<
diff --git a/src/sunstone/test/examples/vm/save_as.json b/src/sunstone/test/examples/vm/saveas.json
similarity index 78%
rename from src/sunstone/test/examples/vm/save_as.json
rename to src/sunstone/test/examples/vm/saveas.json
index 8f4ae8e40e..1ccf3d3698 100644
--- a/src/sunstone/test/examples/vm/save_as.json
+++ b/src/sunstone/test/examples/vm/saveas.json
@@ -4,6 +4,6 @@
       "disk_id": "0",
       "image_name": "new_image"
     },
-    "perform": "save_as"
+    "perform": "saveas"
   }
-}
\ No newline at end of file
+}
diff --git a/src/sunstone/test/spec/vm_spec.rb b/src/sunstone/test/spec/vm_spec.rb
index cecd164724..1ade30e4d8 100644
--- a/src/sunstone/test/spec/vm_spec.rb
+++ b/src/sunstone/test/spec/vm_spec.rb
@@ -35,7 +35,7 @@ describe 'VirtualMachine tests' do
 
         @action_deploy  = File.read(EXAMPLES_PATH + '/vm/deploy.json')
         @action_hold    = File.read(EXAMPLES_PATH + '/vm/hold.json')
-        @action_saveas = File.read(EXAMPLES_PATH + '/vm/save_as.json')
+        @action_saveas = File.read(EXAMPLES_PATH + '/vm/saveas.json')
         @wrong_action   = File.read(EXAMPLES_PATH + '/error/wrong_action.json')
     end
 
@@ -125,7 +125,7 @@ describe 'VirtualMachine tests' do
     end
 
     ############################################################################
-    # Save_as
+    # Saveas
     ############################################################################
     it "should prepare the VirtualMachine 0 disk to be saved" do
         url = '/vm/0/action'
@@ -134,7 +134,7 @@ describe 'VirtualMachine tests' do
         last_response.status.should eql(204)
     end
 
-    it "should get VirtualMachine 0 information after save_as action" do
+    it "should get VirtualMachine 0 information after saveas action" do
         url = '/vm/0'
         get url