Test for idempotent operating system creation in Puppet fact parser
|Assigned To:||Dominic Cleal|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/4026|
|Velocity based estimate||-|
There are small idempotency issues in the Puppet fact parser, leading to bugs such as #17335, where the OS is successfully created on the first run, but subsequent runs fail as the parser tried to recreate an existing OS.
The tests should be expanded to call importer.operatingsystem twice and to verify the OS is unchanged.
#2 Updated by Dominic Cleal over 1 year ago
Other small issues found while expanding these tests:
- On the first run, the OS is an instance of Operatingsystem with the
familyattribute set on save by
set_family, but subsequent runs return an STI subclass. The first run should also return the STI subclass.
- Some newer OSes are missing the refactoring from #3962, causing #class to return Operatingsystem
- The fact parser modifies OS release facts in the incoming hash through #gsub!