Project

General

Profile

Bug #4682

create a new smart variable for a puppet class doesn't save the relation in the database.

Added by Amos Benari over 5 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
Smart Variables
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

steps to reproduce:
1. goto edit puppetclass -> smart variables tab.
2. add a new variable and submit the form.
3. the new smart variable is saved but is not attached to any puppet class.

Associated revisions

Revision df471c78 (diff)
Added by Stephen Benjamin over 5 years ago

fixes #4682 - smart variable for a puppet class not showing in UI

History

#1 Updated by Stephen Benjamin over 5 years ago

Works for me against develop. Added two smart variables to the apache puppetclass and the association shows up (and the host gets the global parameter):

1.8.7 :005 > LookupKey.where(:puppetclass_id => Puppetclass.find_by_name("apache")).select("key, puppetclass_id")
+-----+----------------+
| key | puppetclass_id |
+-----+----------------+
| baz | 60             |
| foo | 60             |
+-----+----------------+

#2 Updated by Dominic Cleal over 5 years ago

  • Category set to Smart Variables
  • Status changed from New to Ready For Testing
  • Assignee set to Stephen Benjamin
  • Target version set to 1.9.0
  • Legacy Backlogs Release (now unused) set to 4

#3 Updated by Stephen Benjamin over 5 years ago

In the end, I was able to reproduce the problem. The Puppetclass view uses "puppetclass.lookup_keys.empty?" and I had a poorly named counter in EnvironmentClasses that was 0 (no other params for the class).

Something to keep in mind if something weird happens like this... rails magic makes .empty? and .size look to the counter cache if it exists.

#4 Updated by Anonymous over 5 years ago

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

Also available in: Atom PDF