Class: Actions::Katello::CapsuleContent::UpdateContentCounts
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Katello::CapsuleContent::UpdateContentCounts
- Defined in:
- app/lib/actions/katello/capsule_content/update_content_counts.rb
Instance Method Summary collapse
- #find_content_view(content_view_id) ⇒ Object
- #find_env(environment_id) ⇒ Object
- #find_repository(repository_id) ⇒ Object
- #humanized_name ⇒ Object
- #plan(smart_proxy, options = {}) ⇒ Object
- #rescue_strategy ⇒ Object
- #run ⇒ Object
Instance Method Details
#find_content_view(content_view_id) ⇒ Object
28 29 30 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 28 def find_content_view(content_view_id) ::Katello::ContentView.find_by(id: content_view_id) if content_view_id end |
#find_env(environment_id) ⇒ Object
24 25 26 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 24 def find_env(environment_id) ::Katello::KTEnvironment.find_by(id: environment_id) if environment_id end |
#find_repository(repository_id) ⇒ Object
32 33 34 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 32 def find_repository(repository_id) ::Katello::Repository.find_by(id: repository_id) if repository_id end |
#humanized_name ⇒ Object
10 11 12 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 10 def humanized_name _("Update Content Counts") end |
#plan(smart_proxy, options = {}) ⇒ Object
5 6 7 8 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 5 def plan(smart_proxy, = {}) input[:options] = plan_self(:smart_proxy_id => smart_proxy.id, environment_id: [:environment_id], content_view_id: [:content_view_id], repository_id: [:repository_id]) end |
#rescue_strategy ⇒ Object
36 37 38 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 36 def rescue_strategy Dynflow::Action::Rescue::Skip end |
#run ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'app/lib/actions/katello/capsule_content/update_content_counts.rb', line 14 def run smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id]) env = find_env(input[:environment_id]) content_view = find_content_view(input[:content_view_id]) repository = find_repository(input[:repository_id]) smart_proxy.update_content_counts!(environment: env, content_view: content_view, repository: repository) end |