Skip to content

Commit

Permalink
Fix issue where plugin settings had higher precedence than manageiq
Browse files Browse the repository at this point in the history
One of the side effects of this is that in production deployments with
overrides, the overrides were being clobbered by the plugins.

https://bugzilla.redhat.com/show_bug.cgi?id=1517938
  • Loading branch information
Fryguy committed Nov 27, 2017
1 parent 670b8d3 commit 63759e4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/vmdb/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,30 +111,28 @@ def self.build_without_local(resource)
private_class_method :build_without_local

def self.template_roots
Vmdb::Plugins.instance.vmdb_plugins.each_with_object([Rails.root.join('config')]) do |plugin, roots|
roots << plugin.root.join('config')
end
Vmdb::Plugins.instance.vmdb_plugins.collect { |p| p.root.join('config') } << Rails.root.join('config')
end
private_class_method :template_roots

def self.template_sources
template_roots.each_with_object([]) do |root, sources|
sources.push(
template_roots.flat_map do |root|
[
root.join("settings.yml").to_s,
root.join("settings/#{Rails.env}.yml").to_s,
root.join("environments/#{Rails.env}.yml").to_s
)
]
end
end
private_class_method :template_sources

def self.local_sources
template_roots.each_with_object([]) do |root, sources|
sources.push(
template_roots.flat_map do |root|
[
root.join("settings.local.yml").to_s,
root.join("settings/#{Rails.env}.local.yml").to_s,
root.join("environments/#{Rails.env}.local.yml").to_s
)
]
end
end
private_class_method :local_sources
Expand Down

0 comments on commit 63759e4

Please sign in to comment.