Sha256: 77f8ced3cf5241d7e0766be8cbe2deab1682905f606873d7224326cdda41660f

Contents?: true

Size: 1.06 KB

Versions: 65

Compression:

Stored size: 1.06 KB

Contents

module Actions
  module Katello
    module Host
      class UploadPackageProfile < Actions::EntryAction
        def queue
          ::Katello::HOST_TASKS_QUEUE
        end

        def plan(host, profile_string)
          action_subject host

          sequence do
            plan_self(:host_id => host.id, :hostname => host.name, :profile_string => profile_string)
          end
        end

        def humanized_name
          if input.try(:[], :hostname)
            _("Package Profile Update for %s") % input[:hostname]
          else
            _('Package Profile Update')
          end
        end

        def resource_locks
          :link
        end

        def rescue_strategy
          Dynflow::Action::Rescue::Skip
        end

        def run
          host = ::Host.find_by(:id => input[:host_id])
          uploader = ::Katello::Host::PackageProfileUploader.new(
            host: host,
            profile_string: input[:profile_string]
          )
          uploader.upload
          uploader.trigger_applicability_generation
        end
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
katello-4.12.1 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.12.0 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.12.0.rc3 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.12.0.rc2 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.12.0.rc1 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.11.1 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.11.0 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.11.0.rc2 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.11.0.rc1 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.10.0 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.9.2 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.10.0.rc2 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.10.0.rc1 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.8.4 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.9.1 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.8.3 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.9.0 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.7.6 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.8.2 app/lib/actions/katello/host/upload_package_profile.rb
katello-4.9.0.rc2 app/lib/actions/katello/host/upload_package_profile.rb