Skip to content

Commit

Permalink
Merge pull request #14122 from imtayadeway/bug/openstack-start-power-…
Browse files Browse the repository at this point in the history
…state

Set the raw power state when starting Openstack instance
  • Loading branch information
agrare authored Mar 1, 2017
2 parents cf91b12 + 383f3b8 commit 62f464b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def raw_start
when "SHELVED", "SHELVED_OFFLOADED" then connection.unshelve_server(ems_ref)
end
end
self.update_attributes!(:raw_power_state => "ACTIVE")
end

def raw_stop
Expand Down
14 changes: 14 additions & 0 deletions spec/models/manageiq/providers/openstack/cloud_manager/vm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,18 @@
vm.resize_revert
end
end

describe "#raw_start" do
it "sets the raw power state to 'ACTIVE'" do
vm = FactoryGirl.create(:vm_openstack,
:ext_management_system => ems,
:cloud_tenant => tenant,
:raw_power_state => "SHUTOFF")
expect(handle).to receive(:start_server)

vm.raw_start

expect(vm.raw_power_state).to eq("ACTIVE")
end
end
end

0 comments on commit 62f464b

Please sign in to comment.