Class: Actions::Katello::CapsuleContent::Sync
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Katello::CapsuleContent::Sync
- Defined in:
- app/lib/actions/katello/capsule_content/sync.rb
Instance Method Summary collapse
- #finalize ⇒ Object
- #humanized_input ⇒ Object
- #humanized_name ⇒ Object
- #plan(smart_proxy, options = {}) ⇒ Object
- #resource_locks ⇒ Object
Instance Method Details
#finalize ⇒ Object
46 47 48 49 50 51 |
# File 'app/lib/actions/katello/capsule_content/sync.rb', line 46 def finalize smart_proxy = SmartProxy.unscoped.(:view_capsule_content).find(input[:smart_proxy_id]) unless smart_proxy&.pulp_primary? smart_proxy&.audit_capsule_sync end end |
#humanized_input ⇒ Object
17 18 19 |
# File 'app/lib/actions/katello/capsule_content/sync.rb', line 17 def humanized_input input['smart_proxy'].nil? || input['smart_proxy']['name'].nil? ? super : ["'#{input['smart_proxy']['name']}'"] + super end |
#humanized_name ⇒ Object
13 14 15 |
# File 'app/lib/actions/katello/capsule_content/sync.rb', line 13 def humanized_name _("Synchronize smart proxy") end |
#plan(smart_proxy, options = {}) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'app/lib/actions/katello/capsule_content/sync.rb', line 21 def plan(smart_proxy, = {}) action_subject(smart_proxy) smart_proxy.verify_ueber_certs environment_id = .fetch(:environment_id, nil) environment = ::Katello::KTEnvironment.find(environment_id) if environment_id repository_id = .fetch(:repository_id, nil) repository = ::Katello::Repository.find(repository_id) if repository_id content_view_id = .fetch(:content_view_id, nil) content_view = ::Katello::ContentView.find(content_view_id) if content_view_id fail _("Action not allowed for the default smart proxy.") if smart_proxy.pulp_primary? = .merge(content_view: content_view, environment: environment, repository: repository) sequence do if smart_proxy.has_feature?(SmartProxy::PULP3_FEATURE) plan_action(Actions::Pulp3::ContentGuard::Refresh, smart_proxy) plan_action(Actions::Pulp3::Orchestration::Repository::RefreshRepos, smart_proxy, ) end plan_action(SyncCapsule, smart_proxy, ) end plan_self(smart_proxy_id: smart_proxy.id) end |
#resource_locks ⇒ Object
5 6 7 |
# File 'app/lib/actions/katello/capsule_content/sync.rb', line 5 def resource_locks :link end |