Project

General

Profile

Bug #24662

"Provision method can't be updated after host is provisioned" error when provision method is changed from implicit to explicit 'build'

Added by Alexander Olofsson 4 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

As shown by a small Rails console example;

irb(main):001:0> h = Host::Managed.find_by(name: 'example-machine')
=> #<Host::Managed id: 4512 ...
irb(main):002:0> h.attributes['provision_method']
=> nil
irb(main):003:0> h.provision_method
=> "build" 
irb(main):004:0> h.provision_method = 'build'
=> "build" 
irb(main):005:0> h.validate!
ActiveRecord::RecordInvalid: Validation failed: Provision method can't be updated after host is provisioned
        from (irb):5
        from lib/tasks/console.rake:5:in `block in <top (required)>'

This error has started occuring for us when combining our own WDS plugin - which seems to cause Foreman to always send the provision method as a parameter when saving hosts, and discovery - which creates discovered host entries that use the implicit 'build' provision method.

Associated revisions

Revision 0dacc639 (diff)
Added by Alexander Olofsson 2 months ago

Fixes #24662 - provision_method change error

History

#1 Updated by The Foreman Bot 3 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6102 added

#2 Updated by Lukas Zapletal 2 months ago

  • Fixed in Releases 1.20.0 added

#3 Updated by Alexander Olofsson 2 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF