Project

General

Profile

Actions

Bug #1351

closed

New smart variable and match cannot be entered at same time.

Added by Steve Traylen over 12 years ago. Updated almost 12 years ago.

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

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.

Actions

Also available in: Atom PDF