Test for idempotent operating system creation in Puppet fact parser
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.
Updated by Dominic Cleal about 7 years 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!