foreman_remote_execution 13.2.7 → 13.2.8

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: 89748fdf3243ae9685bbb1e9dc5ed86fce9ce3f85298a05560f0852fb442047f
4
- data.tar.gz: 5aea7f465b289412dde7e172a0d33cfcdfc790cb343f0261f9dea6bff3b3476f
3
+ metadata.gz: f0995bba1565ba78151872654d71a89d64c73fc66fe4b814800c273eabc3e5cb
4
+ data.tar.gz: 22cc0e52dc17539db11a40a9230e69c7d9d5a3c0ae2a21a245d7c22652d4a0bd
5
5
  SHA512:
6
- metadata.gz: d3463075ef47ecfc51a954e57d13233533771e79a5c824cc736f7ea26b92187219d87200dad49dd5bb77746987d7c41c3264ab3bcd28fd96a1ec00a7640da877
7
- data.tar.gz: 91dcd90e332f5e11c76eaddca395ac91db7d804e90cc48591db98fd82e69083986082c03f971479dacad9f50e369455b7ecb822925617b5bc80cf602e76486cf
6
+ metadata.gz: 76c8f7e4e9b6ab06ebc5e6ba6562be5dafbce07f02172e46dae24604040c9ef6b89c31111bdcda46bee2cf163e526a83158b7cb010c34c73585225fd60f1fb42
7
+ data.tar.gz: db5baca331f172e40b24b740b46f9cb36b2ccf100d31193b11355c76772e748b2155e4afe42eb59c526841efdaa23ac5d92787c6e23304428788897f49f146b5
@@ -1,10 +1,13 @@
1
1
  class MigrateSmartProxyIdsToTemplateInvocations < ActiveRecord::Migration[6.0]
2
2
  def up
3
+ proxy_lookup_cache = {}
3
4
  ForemanTasks::Link.joins(:task)
4
5
  .where(resource_type: 'SmartProxy', task: { label: 'Actions::RemoteExecution::RunHostJob' })
5
6
  .where.not(resource_id: nil)
6
7
  .find_in_batches do |batch|
7
8
  batch.group_by(&:resource_id).each do |resource_id, links|
9
+ proxy_lookup_cache[resource_id] = SmartProxy.where(id: resource_id).exists? unless proxy_lookup_cache.key?(resource_id)
10
+ next unless proxy_lookup_cache[resource_id]
8
11
  template_invocation_ids = ForemanTasks::Link.where(resource_type: 'TemplateInvocation', task_id: links.map(&:task_id)).select(:resource_id)
9
12
  TemplateInvocation.where(id: template_invocation_ids).update_all(smart_proxy_id: resource_id)
10
13
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '13.2.7'.freeze
2
+ VERSION = '13.2.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.2.7
4
+ version: 13.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-02-06 00:00:00.000000000 Z
11
+ date: 2025-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface