Actions
Bug #9045
closedMigration PuppetclassTotalHosts does use a rake task
Description
It is unable to migrate a database that was not yet seeded but containing some Puppetclasses (e.g. older version of Foreman).
Since the Rake task is simple, the solution is to copy the code into migration:
desc "Correct hosts counts for all classes in case they are wrong" task :fix_total_hosts => :environment do if Puppetclass.count > 0 User.current = User.anonymous_admin Puppetclass.all.each(&:update_total_hosts) end end
Actions