foreman-tasks 9.0.4 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 959e8a5bbb07d3d1b6b0d1f0b57f502b4397d5797ccc3037b1e9f77a8229b06a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: f0bef4b1aca4d471a2616e6b41751f1da2165eb23d9da65be87bf055bc4fab05
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2740338c22e5f0371358d037212a2964d4a46119dd2d2275dc290b91742be20bdd2b74ef8b9b036f60e975b4e798424b20776eabfeaa9f49049f24a2389d48c7
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 43ae242cf9b8d2e7e873ab9fa99b5be157d1f9467e931d163ccf0e831d1e1969cd81ceb0391d1397f1d6606ee159b62e88e97202ddeac112579a34cc74f3d698
         
     | 
    
        data/.rubocop.yml
    CHANGED
    
    
| 
         @@ -9,7 +9,8 @@ module Actions 
     | 
|
| 
       9 
9 
     | 
    
         
             
                #   Arguments that all the targets share
         
     | 
| 
       10 
10 
     | 
    
         
             
                def plan(action_class, targets, *args, concurrency_limit: nil, **kwargs)
         
     | 
| 
       11 
11 
     | 
    
         
             
                  check_targets!(targets)
         
     | 
| 
       12 
     | 
    
         
            -
                   
     | 
| 
      
 12 
     | 
    
         
            +
                  extracted_concurrency_limit = extract_concurrency_limit(args, concurrency_limit)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  limit_concurrency_level!(extracted_concurrency_limit) if extracted_concurrency_limit
         
     | 
| 
       13 
14 
     | 
    
         
             
                  plan_self(:action_class => action_class.to_s,
         
     | 
| 
       14 
15 
     | 
    
         
             
                            :target_ids => targets.map(&:id),
         
     | 
| 
       15 
16 
     | 
    
         
             
                            :target_class => targets.first.class.to_s,
         
     | 
| 
         @@ -72,5 +73,11 @@ module Actions 
     | 
|
| 
       72 
73 
     | 
    
         
             
                def total_count
         
     | 
| 
       73 
74 
     | 
    
         
             
                  input[:target_ids].count
         
     | 
| 
       74 
75 
     | 
    
         
             
                end
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                private
         
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
                def extract_concurrency_limit(args = [], limit = nil)
         
     | 
| 
      
 80 
     | 
    
         
            +
                  args.find { |arg| arg.is_a?(Hash) && arg.key?(:concurrency_limit) }&.fetch(:concurrency_limit) || limit
         
     | 
| 
      
 81 
     | 
    
         
            +
                end
         
     | 
| 
       75 
82 
     | 
    
         
             
              end
         
     | 
| 
       76 
83 
     | 
    
         
             
            end
         
     | 
| 
         @@ -23,12 +23,12 @@ module ForemanTasks 
     | 
|
| 
       23 
23 
     | 
    
         
             
                  # @override
         
     | 
| 
       24 
24 
     | 
    
         
             
                  def destroy_action; end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                  def save( 
     | 
| 
       27 
     | 
    
         
            -
                    dynflow_task_wrap(:save) { super( 
     | 
| 
      
 26 
     | 
    
         
            +
                  def save(...)
         
     | 
| 
      
 27 
     | 
    
         
            +
                    dynflow_task_wrap(:save) { super(...) }
         
     | 
| 
       28 
28 
     | 
    
         
             
                  end
         
     | 
| 
       29 
29 
     | 
    
         | 
| 
       30 
     | 
    
         
            -
                  def save!( 
     | 
| 
       31 
     | 
    
         
            -
                    dynflow_task_wrap(:save) { super( 
     | 
| 
      
 30 
     | 
    
         
            +
                  def save!(...)
         
     | 
| 
      
 31 
     | 
    
         
            +
                    dynflow_task_wrap(:save) { super(...) }
         
     | 
| 
       32 
32 
     | 
    
         
             
                  end
         
     | 
| 
       33 
33 
     | 
    
         | 
| 
       34 
34 
     | 
    
         
             
                  def destroy
         
     | 
| 
         @@ -37,14 +37,14 @@ module ForemanTasks 
     | 
|
| 
       37 
37 
     | 
    
         | 
| 
       38 
38 
     | 
    
         
             
                  # In order to use host.<attribute>_changed?, we must assign_attributes to
         
     | 
| 
       39 
39 
     | 
    
         
             
                  # the host record for these update and update! methods.
         
     | 
| 
       40 
     | 
    
         
            -
                  def update( 
     | 
| 
       41 
     | 
    
         
            -
                    assign_attributes( 
     | 
| 
      
 40 
     | 
    
         
            +
                  def update(...)
         
     | 
| 
      
 41 
     | 
    
         
            +
                    assign_attributes(...)
         
     | 
| 
       42 
42 
     | 
    
         
             
                    dynflow_task_wrap(:save) { save }
         
     | 
| 
       43 
43 
     | 
    
         
             
                  end
         
     | 
| 
       44 
44 
     | 
    
         
             
                  alias update_attributes update
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
                  def update!( 
     | 
| 
       47 
     | 
    
         
            -
                    assign_attributes( 
     | 
| 
      
 46 
     | 
    
         
            +
                  def update!(...)
         
     | 
| 
      
 47 
     | 
    
         
            +
                    assign_attributes(...)
         
     | 
| 
       48 
48 
     | 
    
         
             
                    dynflow_task_wrap(:save) { save! }
         
     | 
| 
       49 
49 
     | 
    
         
             
                  end
         
     | 
| 
       50 
50 
     | 
    
         
             
                  alias update_attributes! update!
         
     | 
| 
         @@ -42,9 +42,6 @@ module ForemanTasks 
     | 
|
| 
       42 
42 
     | 
    
         
             
                end
         
     | 
| 
       43 
43 
     | 
    
         | 
| 
       44 
44 
     | 
    
         
             
                def update_from_batch_trigger(data, parent = {})
         
     | 
| 
       45 
     | 
    
         
            -
                  # The ID might get overwritten later, but it is a sane default in case of async
         
     | 
| 
       46 
     | 
    
         
            -
                  # triggering where we only get an id of a remote parent
         
     | 
| 
       47 
     | 
    
         
            -
                  self.remote_task_id = execution_plan_id
         
     | 
| 
       48 
45 
     | 
    
         
             
                  if data['result'] == 'success'
         
     | 
| 
       49 
46 
     | 
    
         
             
                    self.remote_task_id = data['task_id']
         
     | 
| 
       50 
47 
     | 
    
         
             
                    self.state = 'triggered'
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: foreman-tasks
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 9.0 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 9.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Ivan Nečas
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-02-14 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: dynflow
         
     |