Skip to content

Commit

Permalink
[ONE] Using hard flag for VM actions (rel)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Parak committed Jun 22, 2016
1 parent 17015fd commit 136006a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/backends/opennebula/compute.rb
Expand Up @@ -129,7 +129,7 @@ def delete_all(mixins = nil)

backend_compute_pool.each do |backend_compute|
if backend_compute.lcm_state_str == 'RUNNING'
rc = backend_compute.shutdown
rc = backend_compute.shutdown(true)
else
rc = backend_compute.delete
end
Expand Down Expand Up @@ -157,7 +157,7 @@ def delete(compute_id)
check_retval(rc, Backends::Errors::ResourceRetrievalError)

if virtual_machine.lcm_state_str == 'RUNNING'
rc = virtual_machine.shutdown
rc = virtual_machine.shutdown(true)
else
rc = virtual_machine.delete
end
Expand Down
4 changes: 2 additions & 2 deletions lib/backends/opennebula/helpers/compute_action_helper.rb
Expand Up @@ -19,7 +19,7 @@ def trigger_action_restart(compute_id, attributes = ::Occi::Core::Attributes.new
case backend_object.state_str
when 'ACTIVE'
if backend_object.lcm_state_str == 'RUNNING'
rc = backend_object.reboot
rc = backend_object.reboot(true)
else
fail ::Backends::Errors::ResourceActionError,
"Given action is not allowed in this state! [#{backend_object.lcm_state_str.inspect}]"
Expand All @@ -39,7 +39,7 @@ def trigger_action_stop(compute_id, attributes = ::Occi::Core::Attributes.new)
backend_object = trigger_action_prolog(compute_id)
trigger_action_state_check(backend_object, 'http://schemas.ogf.org/occi/infrastructure/compute/action#stop')

rc = backend_object.poweroff
rc = backend_object.poweroff(true)
check_retval(rc, Backends::Errors::ResourceActionError)

true
Expand Down

0 comments on commit 136006a

Please sign in to comment.