Sha256: 93506bd4a33f72d84f1d5e2ce928a787686b1584067a304c5229097f953c74d9
Contents?: true
Size: 690 Bytes
Versions: 72
Compression:
Stored size: 690 Bytes
Contents
module InventoryUpload module TaskActions extend ActiveSupport::Concern class NothingToSyncError < Foreman::Exception MESSAGE = N_('Nothing to sync, there are no hosts with subscription for this organization.') def initialize(**params) super(self.class::MESSAGE, params) end end def start_inventory_sync(selected_org) subscribed_hosts = ForemanInventoryUpload::Generators::Queries.for_slice( Host.unscoped.where(organization: selected_org) ) if subscribed_hosts.empty? raise NothingToSyncError end ForemanTasks.async_task(InventorySync::Async::InventoryFullSync, selected_org) end end end
Version data entries
72 entries across 72 versions & 1 rubygems