Sha256: 72a682ce477bc2bf226c9d12210988cda637d3649756bccaaccf46c950eeba7c
Contents?: true
Size: 1.31 KB
Versions: 19
Compression:
Stored size: 1.31 KB
Contents
module Actions module SccManager class SyncRepositories < Actions::EntryAction include EncryptValue def plan(scc_account) action_subject(scc_account) password = encrypt_field(scc_account.password) plan_self(base_url: scc_account.base_url, login: scc_account.login, password: password) end def run output[:data] = ::SccManager.get_scc_data(input[:base_url], '/connect/organizations/repositories', input[:login], decrypt_field(input[:password])) rescue StandardError => e ::Foreman::Logging.logger('foreman_scc_manager').error "Error while syncronizing SCC-Repositories: #{e}" error! e.to_s end def finalize # this is only executed if 'run' succeeds SccAccount.find(input[:scc_account][:id]).update_scc_repositories(output[:data]) end def rescue_strategy Dynflow::Action::Rescue::Fail end def humanized_name _('Sync SUSE subscriptions (Repositories)') end def humanized_output output.dup.update(data: "Trimmed (got #{output[:data]&.length} repositories") end end end end
Version data entries
19 entries across 19 versions & 1 rubygems