Class: Actions::Pulp::Repos::Update

Inherits:
Abstract
  • Object
show all
Defined in:
app/lib/actions/pulp/repos/update.rb

Instance Method Summary collapse

Methods inherited from Abstract

#pulp_extensions, #pulp_resources

Instance Method Details

#plan(product) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/lib/actions/pulp/repos/update.rb', line 5

def plan(product)
  sync_plan = product.sync_plan

  product.repos(product.library).each do |repo|
    if sync_plan.nil?
      plan_action(::Actions::Pulp::Repository::RemoveSchedule, :repo_id => repo.id)
    else
      plan_action(::Actions::Pulp::Repository::UpdateSchedule,
        :repo_id => repo.id,
        :schedule => sync_plan.schedule_format,
        :enabled => sync_plan.enabled
      )
    end
  end
end