foreman_bootdisk 2.0.6 → 2.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51d62a4894cbc39941a17ecb467122663f3653ea
4
- data.tar.gz: 232a552fd61594f811f7c389d94ca1665f90e48e
3
+ metadata.gz: 968b38fc3cb43d0f3e0f10a7f16cfba11b377934
4
+ data.tar.gz: 30f4b625448bd5dfd994c5d98bd364d5210cbc79
5
5
  SHA512:
6
- metadata.gz: 047d8c45159aba84ce216c22c1ce504afc18b233f3cea0c4cd817a2afd209a0adf26c478a6a96b704abdacce69c7e38f1adaa56370eec25cc3cedf1fa5db35af
7
- data.tar.gz: c223344799a3a3b89ca16fabf94c919a3add08a143cb4ac638ed2bce66e6de00d898921a233d0ff34f5842eb35631fd138906e672ce40ee7d4cabcc90df583a7
6
+ metadata.gz: ca59150ae4a72cf99707eb4dcbb874156a153a8bb97f734a51d55e0ee51d218d50502a698f3dd433719aa2cf2ffdce1f5dc034d045a9c28db2143a0cf1fd3326
7
+ data.tar.gz: a8166ebf290dac36437b9f366214d8f2946f0ed6d095795c0ed63c8dfb6bf26ead386000a158c72538fd6248bffdd94149a1361b98671a54ef397f7ec6dde8de
data/CHANGES.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## v2.0.7
4
+ * change 'kind' of templates to Bootdisk to avoid confusion
5
+
3
6
  ## v2.0.6
4
7
  * fix deletion of non-bootdisk config templates
5
8
 
@@ -0,0 +1,17 @@
1
+ class ChangeTemplatekindToBootdisk < ActiveRecord::Migration
2
+ def self.up
3
+ kind = TemplateKind.find_or_create_by_name('Bootdisk')
4
+ ConfigTemplate.unscoped.where('name LIKE ? OR name = ? OR name = ?', '%Boot disk%',
5
+ Setting[:bootdisk_host_template], Setting[:bootdisk_generic_host_template]).each do |tmpl|
6
+ tmpl.update_attribute(:template_kind_id, kind.id)
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ old_kind = TemplateKind.find_by_name('Bootdisk')
12
+ new_kind = TemplateKind.find_by_name('iPXE')
13
+ if old_kind.present? && new_kind.present?
14
+ ConfigTemplate.unscoped.where(:template_kind_id => old_kind.id).update_all(:template_kind_id => new_kind.id)
15
+ end
16
+ end
17
+ end
data/db/seeds.rb CHANGED
@@ -3,11 +3,13 @@ def format_errors(model = nil)
3
3
  model.errors.full_messages.join(';')
4
4
  end
5
5
 
6
+ kind = TemplateKind.find_or_create_by_name('Bootdisk')
7
+
6
8
  ConfigTemplate.without_auditing do
7
9
  content = File.read(File.join(Bootdisk::Engine.root, 'app', 'views', 'bootdisk', 'host.erb'))
8
10
  ConfigTemplate.find_or_create_by_name(
9
11
  :name => 'Boot disk iPXE - host',
10
- :template_kind_id => TemplateKind.find_by_name('iPXE').try(:id),
12
+ :template_kind_id => kind.id,
11
13
  :snippet => false,
12
14
  :template => content
13
15
  ).update_attribute(:template, content)
@@ -15,7 +17,7 @@ ConfigTemplate.without_auditing do
15
17
  content = File.read(File.join(Bootdisk::Engine.root, 'app', 'views', 'bootdisk', 'generic_host.erb'))
16
18
  ConfigTemplate.find_or_create_by_name(
17
19
  :name => 'Boot disk iPXE - generic host',
18
- :template_kind_id => TemplateKind.find_by_name('iPXE').try(:id),
20
+ :template_kind_id => kind.id,
19
21
  :snippet => false,
20
22
  :template => content
21
23
  ).update_attribute(:template, content)
@@ -1,3 +1,3 @@
1
1
  module Bootdisk
2
- VERSION = '2.0.6'
2
+ VERSION = '2.0.7'
3
3
  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: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-16 00:00:00.000000000 Z
11
+ date: 2014-05-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Plugin for Foreman that creates iPXE-based boot disks to provision hosts
14
14
  without the need for PXE infrastructure.
@@ -42,6 +42,7 @@ files:
42
42
  - db/migrate/20130915133321_create_kickstart_bootdisk_template.rb
43
43
  - db/migrate/20130915201457_create_generic_host_bootdisk_template.rb
44
44
  - db/migrate/20131021095100_edit_host_bootdisk_template_dns_secondary.rb
45
+ - db/migrate/20140522185700_change_templatekind_to_bootdisk.rb
45
46
  - db/seeds.rb
46
47
  - lib/bootdisk/engine.rb
47
48
  - lib/bootdisk/version.rb