Bug #2077
closedOverride option checked when a parameter value is a function
Description
OS: Centos 6.3
Puppet version: 2.6.17 from Epel repo
Puppet modules: Example42 modules (https://github.com/example42)
Foreman version: 1.1 RC3 from rpm upgraded from 1.0.1 while keeping existing Mysql DB.
Steps to reproduce:
Import classes from puppet then go to any imported class and go to smart class parameter. All parameters will appear with the override option checked by default.
Note: Classes were imported using the old version first. I've tried importing all classes several times and is having the same issue.
Updated by Ohad Levy almost 12 years ago
- Assignee set to Amos Benari
- Target version set to 1.1
Amos, do you mind taking a look?
Updated by Ohad Levy almost 12 years ago
- Category set to Puppet integration
OK, digging a bit more into example42 module structure i saw the following
e.g.
class xyz($audit_only = params_lookup( 'audit_only' , 'global' ))
in this case, the value of the parameter depends on an external function (also common when using hiera).
this would lead foreman puppet parser to tell foreman that the audit_only parameter value is empty, in which, in this case, it would assuming its mandatory and required (as if a parameter with no value would fail a puppet catalog compile).
we can probably do two things
- remove the code that defines override/required automatically, make it always a user selection
- let our proxy code detect its a function, and assume a default value is not required.
What do you think?
Updated by Ohad Levy almost 12 years ago
its actually trivial to fix the proxy to detect its a function, e.g. I can easily say detect:
audit_only value is params_lookup("audit_only", "global")
should we just do the same as we do with variable references, and put ${params_lookup...} ? without override / require?
Updated by Ohad Levy almost 12 years ago
- Subject changed from Override option checked by default. to Override option checked when a parameter value is a function
Updated by Ohad Levy almost 12 years ago
- Project changed from Foreman to Smart Proxy
- Category deleted (
Puppet integration) - Target version deleted (
1.1)
Updated by Ohad Levy almost 12 years ago
- Category set to Puppet
- Assignee deleted (
Amos Benari) - Target version set to 1.1
The smart proxy should not report a nil/null value when a parameter is a function.
I suggest we do something similar to how variables are handled, e.g. ${function(param1,param2..paramn)}
Updated by Ohad Levy almost 12 years ago
- Status changed from New to Ready For Testing
possible fix at - https://github.com/theforeman/smart-proxy/pull/51
note, if you already had your class imported, at the moment there is no way to mass un-override them all.
if its a test setup, its best to remove the env (from foreman) and re-import it.
Updated by Ohad Levy almost 12 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 4c3b48371ccdbb61c171c7867798ebecfeffebf5.