mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
Changed ec2 cancel.
This commit is contained in:
parent
547ef24f59
commit
2b7f3c3ce5
@ -31,15 +31,15 @@ require 'ec2_driver'
|
||||
|
||||
deploy_id = ARGV[0]
|
||||
host = ARGV[1]
|
||||
vm_id = ARGV[2]
|
||||
drv_action_enc = STDIN.read.gsub("\n","")
|
||||
|
||||
begin
|
||||
one = OpenNebula::Client.new()
|
||||
vm = OpenNebula::VirtualMachine.new_with_id(vm_id, one)
|
||||
vm.info
|
||||
drv_action = OpenNebula::XMLElement.new
|
||||
drv_action.initialize_xml(Base64.decode64(drv_action_enc),'VMM_DRIVER_ACTION_DATA')
|
||||
lcm_state = OpenNebula::VirtualMachine::LCM_STATE[drv_action["/VMM_DRIVER_ACTION_DATA/VM/LCM_STATE"].to_i]
|
||||
|
||||
ec2_drv = EC2Driver.new(host)
|
||||
ec2_drv.cancel(deploy_id, vm.lcm_state_str)
|
||||
ec2_drv.cancel(deploy_id, lcm_state)
|
||||
rescue Exception => e
|
||||
OpenNebula.handle_driver_exception("Cancel", e, host, deploy_id)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user