Bug #4682
closed
create a new smart variable for a puppet class doesn't save the relation in the database.
Added by Amos Benari almost 11 years ago.
Updated over 6 years ago.
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.
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 |
+-----+----------------+
- 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
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.
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Also available in: Atom
PDF