Project

General

Profile

Actions

Bug #4682

closed

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

Added by Amos Benari about 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Parameters
Target version:
Difficulty:
Triaged:
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.

Actions #1

Updated by Stephen Benjamin about 10 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             |
+-----+----------------+
Actions #2

Updated by Dominic Cleal about 10 years ago

  • Category set to Parameters
  • Status changed from New to Ready For Testing
  • Assignee set to Stephen Benjamin
  • Target version set to 1.9.0
  • translation missing: en.field_release set to 4
Actions #3

Updated by Stephen Benjamin about 10 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.

Actions #4

Updated by Anonymous about 10 years ago

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

Also available in: Atom PDF