Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #10867 - OpenStack boot_from_volume is true only when checked #2498

Closed
wants to merge 1 commit into from

Conversation

dLobatog
Copy link
Member

No description provided.

@compute_resource.expects(:boot_from_volume).times(0)
@compute_resource.create_vm(:boot_from_volume => 'false', :nics => [""],
:flavor_ref => 'foo_flavor', :image_ref => 'foo_image')
Fog.unmock!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put this into a teardown if possible, so it remains unmocked if an assertion is raised.

@domcleal
Copy link
Contributor

domcleal commented Jul 1, 2015

If somebody can test that this works (only boots from volume if ticked), I'd appreciate it, I don't have a working CR.

Edit: @shlomizadok has offered

@stbenjam
Copy link
Member

stbenjam commented Jul 1, 2015

Not testable for me because of http://projects.theforeman.org/issues/10969

@shlomizadok
Copy link
Member

tested, works as expected

@domcleal
Copy link
Contributor

domcleal commented Jul 6, 2015

Merged as 776cff9, thanks @elobato.

@domcleal domcleal closed this Jul 6, 2015
@domcleal
Copy link
Contributor

domcleal commented Jul 6, 2015

Thanks for the test too @shlomizadok!

@dLobatog dLobatog deleted the 10867 branch July 6, 2015 14:31
@AtzeDeVries
Copy link

I'm not sure it is really a bug but i've replaced this openstack.rb with the original on our foreman 1.8.2 (on ubuntu 14.04). This results in the follow error

2015-07-28 10:56:33 [I] Successfully decrypted field for Foreman::Model::Openstack DevOps
2015-07-28 10:56:34 [W] Failed to create a compute DevOps (OpenStack) instance testur.openstacklocal: uninitialized constant Foreman::Cast
/usr/share/foreman/app/models/compute_resources/foreman/model/openstack.rb:93:in rescue in create_vm' /usr/share/foreman/app/models/compute_resources/foreman/model/openstack.rb:77:increate_vm'
/usr/share/foreman/app/models/concerns/orchestration/compute.rb:76:in setCompute' /usr/share/foreman/app/models/concerns/orchestration.rb:141:inexecute'
/usr/share/foreman/app/models/concerns/orchestration.rb:86:in block in process' /usr/share/foreman/app/models/concerns/orchestration.rb:78:ineach'
/usr/share/foreman/app/models/concerns/orchestration.rb:78:in process' /usr/share/foreman/app/models/concerns/orchestration.rb:19:inon_save'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:649:in _run__1750397551040917370__save__2678967843180454136__callbacks' /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:405:in__run_callback'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:385:in _run_save_callbacks' /usr/share/foreman/vendor/ruby/1.9.1/gems/activesupport-3.2.21/lib/active_support/callbacks.rb:81:inrun_callbacks'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/callbacks.rb:264:in create_or_update' /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/persistence.rb:84:insave'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/validations.rb:50:in save' /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/attribute_methods/dirty.rb:22:insave'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:259:in block (2 levels) in save' /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:313:inblock in with_transaction_returning_status'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in transaction' /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:208:intransaction'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:311:in with_transaction_returning_status' /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:259:inblock in save'
/usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:270:in rollback_active_record_state!' /usr/share/foreman/vendor/ruby/1.9.1/gems/activerecord-3.2.21/lib/active_record/transactions.rb:258:insave'

@domcleal
Copy link
Contributor

It uses another feature that's only in 1.9 or higher, you could probably add this file to your installation: https://github.com/theforeman/foreman/blob/develop/lib/foreman/cast.rb (or wait for 1.8.3)

@AtzeDeVries
Copy link

Ok thnx, i just commented line 77 (in https://github.com/eLobato/foreman/blob/d7ad9f58fdc60de98381c274b1c75ac794155302/app/models/compute_resources/foreman/model/openstack.rb). We won't be using boot from volume.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants