Project

General

Profile

Actions

Bug #9045

closed

Migration PuppetclassTotalHosts does use a rake task

Added by Lukas Zapletal over 9 years ago. Updated about 8 years ago.

Status:
Rejected
Priority:
Normal
Category:
DB migrations
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 #1

Updated by The Foreman Bot over 9 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2098 added
  • Pull request deleted ()
Actions #2

Updated by Lukas Zapletal about 8 years ago

  • Status changed from Ready For Testing to Closed

Closing old ticket.

Actions #3

Updated by Dominic Cleal about 8 years ago

  • Status changed from Closed to Rejected
Actions

Also available in: Atom PDF