Project

General

Profile

Actions

Bug #21176

closed

Plugin#parameter_filter doesn't work properly with block argument

Added by Ivan Necas over 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

In plugin api for rex, we had

parameter_filter(Nic::Interface, :execution)

This didn't work, because the filter works only for non-nested params (which nic isn't).
Therefore, we needed to use block instead.

parameter_filter Nic::Interface do |ctx|
  ctx.permit :execution      
end

The problem is, we're using filter.pop
https://github.com/theforeman/foreman/blob/616669d83b0f568bbe0bf13013de042bbf4f3951/app/services/foreman/parameter_filter.rb#L19
which leads to the rules to loosing the saved block at the first call, and leads to the rules to not actually apply.


Related issues 1 (0 open1 closed)

Blocks Foreman Remote Execution - Bug #21178: unable to set non-primary remote execution interfaceClosedIvan Necas10/03/2017Actions
Actions

Also available in: Atom PDF