Class: Actions::SccManager::Sync

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/scc_manager/sync.rb

Overview

for dynflow documentation see here: dynflow.github.io/documentation/

Instance Method Summary collapse

Instance Method Details

#finalizeObject



16
17
18
19
20
# File 'app/lib/actions/scc_manager/sync.rb', line 16

def finalize
  # this is only executed if run actions of SyncRepositories and SyncProducts were successful
   = SccAccount.find(input[:scc_account][:id])
  .update! synced: Time.current
end

#humanized_nameObject



26
27
28
# File 'app/lib/actions/scc_manager/sync.rb', line 26

def humanized_name
  _('Sync SUSE subscriptions')
end

#plan(scc_account) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'app/lib/actions/scc_manager/sync.rb', line 5

def plan()
  ::Foreman::Logging.logger('foreman_scc_manager')
                    .info("Initiating 'sync' for SccAccount '#{.name}'.")
  action_subject()
  sequence do
    plan_action(::Actions::SccManager::SyncRepositories, )
    plan_action(::Actions::SccManager::SyncProducts, )
    plan_self
  end
end

#rescue_strategyObject



22
23
24
# File 'app/lib/actions/scc_manager/sync.rb', line 22

def rescue_strategy
  Dynflow::Action::Rescue::Fail
end