foreman_column_view
foreman_column_view copied to clipboard
Failure: undefined method `drop' for :bmc_available?:Symbol
Trying to set up a button in the host view that only appears for Mac machines, however whatever condition statement I try I get the same error.
Failure: undefined method `drop' for :bmc_available?:Symbol
:ssh_to:
:title: Remote Control
:after: 2
:content: link_to(_("SSH"), "ssh://admin@#{host.facts_hash['ipaddress']}", { :class => "btn btn-info" } )
:conditional: :bmc_available?
:eval_content: true
:view: :hosts_properties
Foreman 1.15.3
Also any help on what my conditional should look like would be greatly appreciated.
:conditional: :facts_hash['kernel'] = Darwin
Many thanks
Matt
I assume it's this method call:
https://github.com/GregSutcliffe/foreman_column_view/blob/706a2e06b5b261ff1328acbfc92406b47ebed811/app/helpers/foreman_column_view/hosts_helper_extension.rb#L18
has drop been replaced by something else?
Hey, sorry for the delay.
drop
only operates on an array, which is what it's expecting (as you can see for the line above where it calls conditional[0]
). I'm surprised the default doesn't work though - can you try it as an array? eg
:ssh_to:
:conditional:
- :bmc_available?
I appear to be running into the same issue. Placing the conditional into an array didn't fix anything. Would you be able to provide documentation for how to specify the conditional?
On my end, the array syntax worked (but I got the same error when not using the array syntax). Here's my full snippet:
:console:
:title: IPMI Console
:after: 0
:content: link_to(_("Console"), "https://#{host.interfaces.first.name}", { :class => "btn btn-info" } )
:conditional:
- :bmc_available?
:eval_content: true
:view: :hosts_properties
Hope that helps!