Sha256: 9b286b1ba051db19cf02166ddfa53a0b7bfaa661d49b6bbd144f7466c8c55a80

Contents?: true

Size: 663 Bytes

Versions: 25

Compression:

Stored size: 663 Bytes

Contents

if ForemanOpenscap.with_remote_execution?
  User.as_anonymous_admin do
    JobTemplate.without_auditing do
      Dir[File.join("#{ForemanOpenscap::Engine.root}/app/views/job_templates/**/*.erb")].each do |template|
        sync = !Rails.env.test? && Setting[:remote_execution_sync_templates]
        # import! was renamed to import_raw! around 1.3.1
        if JobTemplate.respond_to?('import_raw!')
          JobTemplate.import_raw!(File.read(template), :default => true, :locked => true, :update => sync)
        else
          JobTemplate.import!(File.read(template), :default => true, :locked => true, :update => sync)
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
foreman_openscap-0.7.5 db/seeds.d/75-job_templates.rb
foreman_openscap-0.8.0 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.4 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.3 db/seeds.d/75-job_templates.rb
foreman_openscap-0.7.2 db/seeds.d/75-job_templates.rb