Sha256: 0992801d9774db828b35868570ccc396d3489b4fda22e964c2e369f38656b86b
Contents?: true
Size: 662 Bytes
Versions: 49
Compression:
Stored size: 662 Bytes
Contents
class FakeDiscoveredHost < ApplicationRecord self.table_name = 'hosts' end class FillDiscoveryAttributeSetsForExistingHosts < ActiveRecord::Migration[4.2] def up FakeDiscoveredHost.where(:type => "Host::Discovered").all.each do |host| begin say "Populating attribute set for discovered host #{host.name}" ForemanDiscovery::ImportHooks::DiscoveryAttribute.new(host: host, facts: host.facts_hash).after_populate host.save! rescue Exception => e say "Error while populating host #{host.name}, deleting: #{e.message}:\n" + e.backtrace.join("\n") host.destroy end end end def down end end
Version data entries
49 entries across 49 versions & 1 rubygems