Grub_pass & ks_console

Hi devs,

as part of the template rendering refactoring, I want to remove UnattendedHelper.

The helper defines two macros: grub_pass and ks_console. Both macros rely on the instance variables @port, @baud and @grub being set.

As far as I’m concerned, these instance variables are defined nowhere and the code is pretty much dead. It actually has been dead for at least >= Foreman 0.4.

Are they still needed?


1 Like


But I would be happy if @lzap confirms it truly is since I think he’s most familiar with this.

Both would need to be removed from kickstart template. There’s no guarantee people don’t use it in their custom templates where they set some value to these variables. I think we should either ask users first, this thread is tagged as Development. Or at least provide a deprecation warning or drawer notification if they are used before we remove them.

cc @ohadlevy since IIRC he was aware of someone using ks_console

while the macro is in the template, the code seems to indicate that these two both return empty strings since @grub, @port and @baud do not seem to be set anywhere. If we want to be on the safe side, we can add a deprecation warning to these and remove in 1.21.

I’d also be happy to make these macros work again, but I’d need some help how these macros are supposed to be used.

The git log suggests they used to be set via host parameters but I’m not sure that still worked when they were refactored into helpers.

That’s interesting, I have not found this while digging in the code. The only use case I could imagine was having a template like this

<% @grub = true %>
<%= grub_pass %>

But that does not read very good.

I can’t remember anyone using it now atm, maybe we can somehow let users know about deprecation after an upgrade using the notification drawer? (or even scan if they have deprecated functions and then let them know…?)

1 Like

@ohadlevy: Do you still remember how this was supposed to be used in the initial implementation?