Project

General

Profile

Bug #3815

smart variable setting breaks hosts in environment

Added by Sachar de Vries about 8 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Parameters
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Hello,

In foreman 1.2.0 setting a smart variable to the following will make all hosts in that environment inaccessible through forman (both UI and for yam facts). Trying to edit the host shows the following:

undefined method `<' for nil:NilClass

NoMethodError
undefined method `<' for nil:NilClass
app/models/classification/base.rb:64:in `block (2 levels) in values_hash'
app/models/classification/base.rb:54:in `block in values_hash'
app/models/classification/base.rb:53:in `each'
app/models/classification/base.rb:53:in `values_hash'
app/models/classification/base.rb:16:in `inherited_values'
app/views/puppetclasses/_class_parameters.html.erb:2:in `_app_views_puppetclasses__class_parameters_html_erb__3825486531141653683_69928692138800'
app/views/puppetclasses/_classes_parameters.html.erb:12:in `_app_views_puppetclasses__classes_parameters_html_erb___1221309847069606095_69928692280220'
app/views/hosts/_form.html.erb:83:in `block (2 levels) in _app_views_hosts__form_html_erb___1154123526843938245_69928694609080'
app/helpers/layout_helper.rb:211:in `form_for'
app/views/hosts/_form.html.erb:7:in `block in _app_views_hosts__form_html_erb___1154123526843938245_69928694609080'
app/models/taxonomy.rb:55:in `block (2 levels) in as_taxonomy'
lib/foreman/thread_session.rb:140:in `as_location'
app/models/taxonomy.rb:54:in `block in as_taxonomy'
lib/foreman/thread_session.rb:105:in `as_org'
app/models/taxonomy.rb:53:in `as_taxonomy'
app/views/hosts/_form.html.erb:5:in `_app_views_hosts__form_html_erb___1154123526843938245_69928694609080'
app/views/hosts/edit.html.erb:7:in `_app_views_hosts_edit_html_erb__838330452706467575_69928694593680'
lib/foreman/thread_session.rb:31:in `clear_thread'

Issue is caused by setting the following smart variable for a puppet class:
match: environment=<env name>
value: 1

while not having environment specified in the Order box. The moment I add environment to the order box the hosts in that environment are available again.

Also available in: Atom PDF