- Red Hat Satellite 6.4
- Getting error
undefined method '#params' for Host::Managed::Jailwhen provisioning a VM using Red Hat Satellite 6.
Follow below steps on the Red Hat Satellite server to resolve the issue:
- After upgrading Satellite to version 6.4, customized or cloned templates requires modification as follows.
@host.params['parameter1'] -> host_param('parameter1') @host.param_true?('parameter1') -> host_param_true?('parameter1') @host.param_false?('parameter1') -> host_param_false?('parameter1') @host.info['parameters']['realm'] -> host_enc['parameters']['realm']
- The process uses simple text replacement which will not work in all cases, e.g. when host is assigned to a variable:
myhost = @host myhost.params['wont_work']
In the customized kickstart template, use the
redhat_registersnippet instead of
The snippet used in the versions before Satellite 6.4 was:
<%= snippet "subscription_manager_registration" %>
The snippet used from Satellite 6.4 onwards is:
<%= snippet 'redhat_register' %>
After upgrading Satellite to version 6.4, verify all templates, parameters, lookup keys, and values of the old-syntax and replace them manually.
You can run the following query on the Satellite server to check what templates are still using the old syntax.
# su - postgres -c "psql foreman -c \"select name, type, snippet from templates where template ilike '%host.params%';\""
Red Hat Satellite 6.4 upgrade process automatically tries to find macros that have been deprecated and convert them into new syntax for all templates, parameters, and lookup keys and values but this is done only for read-only (default) templates. All customized templates need to be modified manually.
From Satellite 6.4 onwards, the
subscription_manager_registrationsnippet has been deprecated and replaced with
The following error can be seen in
2018-04-29T08:11:03 [W|app|eac4b] There was an error rendering the Satellite Kickstart Default Finish template: | ActionView::Template::Error: undefined method '#params' for Host::Managed::Jail (Host::Managed) | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.4/lib/safemode/jail.rb:22:in `method_missing' | Satellite Kickstart Default Finish:66:in `bind' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.4/lib/safemode.rb:51:in `eval' | /opt/theforeman/tfm/root/usr/share/gems/gems/safemode-1.3.4/lib/safemode.rb:51:in `eval' | /usr/share/foreman/lib/foreman/renderer.rb:128:in `render_safe' | /usr/share/foreman/lib/foreman/renderer.rb:246:in `unattended_render'
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.