Skip to content

Commit

Permalink
Fixes #24776 - kexec templates taxonomy and locking (theforeman#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap authored and Ron-Lavi committed Nov 9, 2020
1 parent 7c3dbde commit 780d818
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion db/seeds.d/50_discovery_templates.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
kind = TemplateKind.unscoped.where(:name => 'kexec').first_or_create
organizations = Organization.unscoped.all
locations = Location.unscoped.all

ProvisioningTemplate.without_auditing do
[['redhat_kexec.erb', 'Red Hat'], ['debian_kexec.erb', 'Debian']].each do |tmpl_names|
Expand All @@ -12,8 +14,10 @@
:template => content,
:default => true,
:vendor => "Foreman Discovery",
:locked => false
:locked => true
}
tmpl.organizations = organizations if SETTINGS[:organizations_enabled]
tmpl.locations = locations if SETTINGS[:locations_enabled]
tmpl.save!(:validate => false) if tmpl.changes.present?
end
end

0 comments on commit 780d818

Please sign in to comment.