Sha256: 5cba9ad3ab4ec51440197e6be48b068fc161f00c7b874f4bf12a330299cefe92

Contents?: true

Size: 654 Bytes

Versions: 3

Compression:

Stored size: 654 Bytes

Contents

module Actions
  module Middleware
    class RecordSmartProxySyncHistory < Dynflow::Middleware
      def run(*args)
        if (action.input[:repository_id] && (action.input[:smart_proxy_id] || action.input[:capsule_id]) && !self.action.output[:smart_proxy_history_id])
          repo = ::Katello::Repository.find(action.input[:repository_id])
          smart_proxy_id = action.input[:smart_proxy_id] || action.input[:capsule_id]
          smart_proxy = ::SmartProxy.find(smart_proxy_id)
          self.action.output[:smart_proxy_history_id] = repo.create_smart_proxy_sync_history(smart_proxy)
        end
        pass(*args)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
katello-3.18.0 app/lib/actions/middleware/record_smart_proxy_sync_history.rb
katello-3.18.0.rc2.1 app/lib/actions/middleware/record_smart_proxy_sync_history.rb
katello-3.18.0.rc2 app/lib/actions/middleware/record_smart_proxy_sync_history.rb