app/lib/actions/katello/capsule_content/sync.rb in katello-3.0.2 vs app/lib/actions/katello/capsule_content/sync.rb in katello-3.1.0.rc1
- old
+ new
@@ -9,10 +9,11 @@
def humanized_name
_("Synchronize capsule content")
end
def plan(capsule_content, options = {})
+ capsule_content.ping_pulp
action_subject(capsule_content.capsule)
environment = options.fetch(:environment, nil)
repository = options.fetch(:repository, nil)
content_view = options.fetch(:content_view, nil)
@@ -27,16 +28,14 @@
plan_action(Pulp::Repository::Refresh, repo, capsule_id: capsule_content.capsule.id)
end
plan_action(ConfigureCapsule, capsule_content, environment, content_view)
- smart_proxy = SmartProxy.where(:content_host_id => capsule_content.consumer.id).first
- fail _("Smart Proxy not found for capsule.") unless smart_proxy
concurrence do
repository_ids.each do |repo_id|
plan_action(Pulp::Consumer::SyncCapsule,
- capsule_id: smart_proxy.id,
+ capsule_id: capsule_content.capsule.id,
repo_pulp_id: repo_id)
end
end
plan_action(RemoveOrphans, :capsule_id => capsule_content.capsule.id)
end
@@ -79,11 +78,11 @@
def repos_needing_importer_updates(capsule, environment, content_view)
repos = capsule.repos_available_to_capsule(environment, content_view)
repos.select do |repo|
repo_details = capsule.pulp_repo_facts(repo.pulp_id)
next unless repo_details
- capsule_importer = repo_details["importers"][0].try(:[], "config")
- capsule_importer.nil? || !(repo.importer_matches?(capsule_importer))
+ capsule_importer = repo_details["importers"][0]
+ !(repo.importer_matches?(capsule_importer))
end
end
def rescue_strategy
Dynflow::Action::Rescue::Skip