Bug #1351
closedNew smart variable and match cannot be entered at same time.
Description
Following on from IRC:
Foreman 0.4.0
If I add a new smart variable to a class and also add a match within the same form
then the smart variable is not saved.
e.g entering a smart variable form of:
name=editfirewall default value=true type validate=list validator constraint=true, false order=fqdn,hostgrou,os,domain match=fqdn=lxfssm4408.example.ch value=true
results in a log of
Parameters: {"commit"=>"Submit", "authenticity_token"=>"QWtrc1fTFhDiKpkk2AcNMtNBp4eEc/1oXGdX2cKTbJk=", "id"=>"firewall", "puppetclass"=>{"lookup_keys_attributes"=>{"new_lookup_keys"=>{"default_value"=>"", "validator_rule"=>"", "updated_at"=>"1322075394", "lookup_values_attributes"=>{"new_lookup_values"=>{"value"=>"", "_destroy"=>"", "match"=>""}}, "path"=>"fqdn\r\nhostgroup\r\nos\r\ndomain", "_destroy"=>"", "description"=>"", "validator_type"=>"", "key"=>""}, "new_1322075399382"=>{"default_value"=>"true", "validator_rule"=>"true,false", "updated_at"=>"1322075394", "lookup_values_attributes"=>{"new_1322075455358"=>{"value"=>"false", "_destroy"=>"", "match"=>"fqdn=lxfssm4408.example.ch"}, "new_lookup_values"=>{"value"=>"", "_destroy"=>"", "match"=>""}}, "path"=>"fqdn\r\nhostgroup\r\nos\r\ndomain", "_destroy"=>"", "description"=>"Use puppet firewall rules.", "validator_type"=>"list", "key"=>"editfirewall"}}, "name"=>"firewall", "environment_ids"=>["6", "", "10", "", "9", "", "14", ""], "hostgroup_ids"=>["", "", "", "", "", "", "", "", "", "", ""]}}
but the variable is not saved.
Workaround given on IRC.
Add the smart variable first with no match conditions and then add the match conditions as separate
form submits.
Updated by Ohad Levy about 13 years ago
- Assignee set to Amos Benari
@Amos, this seems like the template html used to add a new variable is actually inside the form, so the default submit would always include it.
more then that, the error can't be shown, as the whole div is hidden.
I tried to have a look, but it breaks a bit the pills structure, do you mind taking a look?
Updated by Tray Torrance almost 13 years ago
I'm hitting this at the nightly release I installed last tuesday, as well. Threw me for quite the loop, as they show up as existing under the "Smart Variables" section of the associated puppet class, but not in the general listing page for "Smart Variables".
-torrancew
Updated by Amos Benari over 12 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset 7a2e06bdc1247693dea53e0698117652402c4751.