Bug #17238

Able to override Smart Variable for non-existent attribute

Added by Ori Rabin 11 months ago. Updated 10 months ago.

Status:Closed
Priority:Normal
Assigned To:Ori Rabin
Category:Smart Variables
Target version:Team Ivan Iteration 6
Difficulty: Bugzilla link:1379277
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3997
Story points-
Velocity based estimate-
Release1.14.0Release relationshipAuto

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1379277

Description of problem:
We can create matcher for Smart Variable for non-existent attribute in CLI which is basically forbidden in UI and is not correct from logic perspective.
Then in UI, attribute type for that matcher is shown as empty value. Smart variable cannot be edited till matcher is deleted

Version-Release number of selected component (if applicable):
6.2.x
6.3.x

How reproducible:
Always

Steps to Reproduce:
Just an example
1. hammer -v -u admin -p changeme --output=csv smart-variable create --default-value="true" --variable="3LNdaiFVwZ" --puppet-class="ntp" --variable-type="boolean"
2. hammer -v -u admin -p changeme --output=csv smart-variable add-override-value --smart-variable-id="113" --value="false" --match="something_is_here=true"
3.

Actual results:
Matcher is added to Smart Variable

Expected results:
Some validation should be performed like we have in UI that will restrict override procedure for non-existent attributes

Additional info:


Related issues

Related to Foreman - Bug #18281: Host class parameter override of smart class parameter un... New 01/27/2017

Associated revisions

Revision 0b5f7acb
Added by Ori Rabin 10 months ago

Fixes #17238 - Validates lookup value match exists in key path

History

#1 Updated by Ori Rabin 11 months ago

  • Status changed from New to Assigned
  • Assigned To set to Ori Rabin

#2 Updated by The Foreman Bot 11 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3997 added

#3 Updated by Ivan Necas 11 months ago

  • Target version set to Team Ivan Iteration 6

#4 Updated by Ori Rabin 10 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal 10 months ago

  • Release set to 1.14.0

#6 Updated by Martin Moerch 8 months ago

  • Related to Bug #18281: Host class parameter override of smart class parameter unable to save when "fqdn" is not in order list added

Also available in: Atom PDF