Remove DB queries from class of UnattendedController
UnattendedController makes DB queries for TemplateKinds in the class scope to define methods and set up action filters. This bad style causes a problem in foreman_bootdisk which adds a method chain to the provision method in the class. When running tests under Rails 4, if the controller's instantiated too early, the right methods aren't defined.
4) Error: UnattendedControllerTest#test_0002_should get a kickstart even if not using the first NIC: AbstractController::ActionNotFound: The action 'provision' could not be found for UnattendedController test/functional/unattended_controller_test.rb:43:in `block in <class:UnattendedControllerTest>'
Changing this to make queries when it's called would create more testable code both in core and the plugin.
fixes #13039 - remove TemplateKind DB calls from UnattendedCtlr
UnattendedController created actions/methods during initialisation per
known TemplateKind, relying on the DB being populated. This caused
ordering issues when a plugin loaded the controller in a test
environment as the kinds weren't yet in the DB. The actions then were
The per-TemplateKind actions have been simplified to one fixed action
which is routed in the same way.