Project

General

Profile

« Previous | Next » 

Revision c6e02bd3

Added by Joseph Magen over 10 years ago

fixes #3178 - add feature for compute profiles for hostgroups and hosts

View differences:

app/models/hostgroup.rb
ancestors.map{|a| a.name + "/"}.join + name
end
def inherited_compute_profile_id
read_attribute(:compute_profile_id) || nested_compute_profile_id
end
def compute_profile
ComputeProfile.find_by_id(inherited_compute_profile_id)
end
private
def lookup_value_match
......
nil
end
def nested_compute_profile_id
Hostgroup.sort_by_ancestry(ancestors.where('compute_profile_id > 0')).last.try(:compute_profile_id) if ancestry.present?
end
def remove_duplicated_nested_class
self.puppetclasses -= ancestors.map(&:puppetclasses).flatten
end

Also available in: Unified diff