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 #1

Updated by Ohad Levy about 12 years ago

  • Target version set to 1.0
Actions #2

Updated by Ohad Levy about 12 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?

Actions #3

Updated by Tray Torrance about 12 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

Actions #4

Updated by Amos Benari almost 12 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF