foreman_bootdisk 19.0.1 → 19.0.4

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: c39668300d2a5a68390be2bda58d3559441a09d1b25e1b7d061bde4231ee7e9c
4
- data.tar.gz: 4068117bc381e9014aaa52d0b7ebb773d356c3307b2a08ec66a633b5455b22e1
3
+ metadata.gz: e151b0d369d747ceccf1004e4354af440c9588e245fc04ad0a381768cfddb2a0
4
+ data.tar.gz: 2a854b9ba6a9b6a10c7d508466b6fbebbb3b93a8dfe9c559f45f6665fa11a6f2
5
5
  SHA512:
6
- metadata.gz: a1b23054266e36961e187c1013a4d0efa63adb4a66b93cdfc23cb93796c41fe3cccc5f77cad15ede3023a26a7d99c28c2ab14c144ea661be0b4d800a8df82ebc
7
- data.tar.gz: 5a55ed870b9c65bf6019695e1562fc28bf50672ef523d87170979374d5baed59d47c3be55e29fb177c88a44bfab5a7978f79f2482985c4f8fcd7e197c0b2060b
6
+ metadata.gz: e7de04a6d18e406abfbd7da559e13979a0463dc5442bbb8235ad01a8ac37368c29007a9259a50d5ef4a705a350d4cf445fcafe282b464bf82853b8ee9dd9f135
7
+ data.tar.gz: 2ec994812ab6672a4e6859f614e45f8fa68bb876920f2f8e229019bf3400fed3d37992c65d8347542a1a3d9b9b4d61bd2b606b3eb28432e0c77043e530aedbfe
@@ -170,8 +170,7 @@ module ForemanBootdisk
170
170
  # Also we cannot rely on systemd-tmpfiles-clean as private temporary files are not subject
171
171
  # of scheduled cleanups. Let's clean bootdisks from prevous requests manually by finding
172
172
  # and deleting all directories created 30 minutes ago.
173
- delete_older_than = Time.now.to_i - (60 * 30)
174
- Rails.root.glob('tmp/bootdisk-iso-*').select { |f| File.ctime(f) < delete_older_than }.each { |f| FileUtils.rm_f(f) }
173
+ Rails.root.glob('tmp/bootdisk-iso-*').select { |f| File.ctime(f) < (Time.now.getlocal - 30.minutes) }.each { |f| FileUtils.rm_rf(f) }
175
174
  end
176
175
 
177
176
  def self.build_mkiso_command(output_file:, source_directory:, extra_commands:)
@@ -2,11 +2,12 @@
2
2
 
3
3
  class ChangeTemplatekindToBootdisk < ActiveRecord::Migration[4.2]
4
4
  class FakeConfigTemplate < ApplicationRecord
5
- self.table_name = if defined? ConfigTemplate
5
+ self.table_name = if ActiveRecord::Base.connection.data_source_exists?("config_templates")
6
6
  'config_templates'
7
7
  else
8
8
  'templates'
9
9
  end
10
+ self.inheritance_column = :_type_disabled
10
11
  end
11
12
 
12
13
  def self.up
@@ -15,10 +16,8 @@ class ChangeTemplatekindToBootdisk < ActiveRecord::Migration[4.2]
15
16
  tmpl_h = Setting.find_by(name: 'bootdisk_host_template').try(:value)
16
17
  tmpl_g = Setting.find_by(name: 'bootdisk_generic_host_template').try(:value)
17
18
 
18
- (FakeConfigTemplate.unscoped.where('name LIKE ?', '%Boot disk%') |
19
- FakeConfigTemplate.unscoped.where(name: [tmpl_h, tmpl_g].compact)).each do |tmpl|
20
- tmpl.update_attribute(:template_kind_id, kind.id)
21
- end
19
+ FakeConfigTemplate.unscoped.where('name LIKE ?', '%Boot disk%').update_all(template_kind_id: kind.id)
20
+ FakeConfigTemplate.unscoped.where(name: [tmpl_h, tmpl_g].compact).update_all(template_kind_id: kind.id)
22
21
  end
23
22
 
24
23
  def self.down
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanBootdisk
4
- VERSION = '19.0.1'
4
+ VERSION = '19.0.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_bootdisk
3
3
  version: !ruby/object:Gem::Version
4
- version: 19.0.1
4
+ version: 19.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-12 00:00:00.000000000 Z
11
+ date: 2022-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: theforeman-rubocop