Skip to content

Commit

Permalink
Fixes #34550 - run no migration tasks if nothing to migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsherrill committed Mar 4, 2022
1 parent 27d820d commit a7d948a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/services/katello/pulp3/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ def pulp2_repositories_api

def create_and_run_migrations
migs = create_migrations
migs.map { |href| start_migration(href) }
if migs.any?
migs.map { |href| start_migration(href) }
else
[]
end
end

def self.ignorable_content_types
Expand Down
3 changes: 2 additions & 1 deletion app/services/katello/pulp3/migration_plan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ def generate
end

def generate_plugins
@repository_types.sort.map do |repository_type|
plugins = @repository_types.sort.map do |repository_type|
{
type: self.class.pulp2_repository_type(repository_type),
repositories: repository_migrations(repository_type)
}
end
plugins.select { |plugin| plugin[:repositories].any? }
end

def self.pulp2_repository_type(repository_type)
Expand Down

0 comments on commit a7d948a

Please sign in to comment.