foreman_bootdisk 5.0.0 → 6.0.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
  SHA1:
3
- metadata.gz: adbc8a5cad8e57bb7a872e5091de1d0be8848603
4
- data.tar.gz: 6078ba730289b9857097df49467149fac0c254ef
3
+ metadata.gz: ffdf260d555ad64c9c24397f293902ab11750afe
4
+ data.tar.gz: 737a352d301347d4cf8a7549822e7e1b0cb5ae95
5
5
  SHA512:
6
- metadata.gz: f50b764848cec817cdeaa0121f15e22f0963f93367734572d20a0c21e02afb2b0a99527d9f72a831b29400c5ed639d3d5f72b5e95cd4bc83e5623e915b389f84
7
- data.tar.gz: e13b29571fe76e38ba1c82f9b68f7def33e11c0838b95978871856b585a95c1c7ff80c2cbfd1f6a901852a88addb91b23016ce0d575d3c141674dac7cdfed11f
6
+ metadata.gz: 51d13826e62222446b190c2d031f24a9cbd360f8e3e8f7aab0024b2b392edafd1b56a01c6f000594581cef58c8e8fed27e529fdb434ca737f5d91c5afc7e01e0
7
+ data.tar.gz: d3c6946fe6fbdede2d47edeb0844dbbc3625bf46ad1e7dfdf07e4aa695967de44d70aef37dc8ad7f1dfbe635fdfb4ffc5a7eb1ed00b3f6481940316349db222d
data/CHANGES.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## v6.0.0
4
+ * compatibility with Foreman 1.9 template changes (#10773)
5
+ * generate correct links under sub-URI (#10494)
6
+ * fix tests on Foreman 1.9
7
+ * remove old compatibility warning
8
+ * requires Foreman 1.9+
9
+
3
10
  ## v5.0.0
4
11
  * configure host provisioning interface in host ISO, not primary
5
12
  * syslinux v6 compatibility, include ldlinux.c32
data/README.md CHANGED
@@ -40,6 +40,7 @@ gPXE images are unsupported due to lack of initrd support.
40
40
  | >= 1.6 | ~> 3.0 |
41
41
  | >= 1.7 | ~> 4.0 |
42
42
  | >= 1.8 | ~> 5.0 |
43
+ | >= 1.9 | ~> 6.0 |
43
44
 
44
45
  # Usage
45
46
 
@@ -29,7 +29,7 @@ module ForemanBootdisk::HostsHelperExt
29
29
  end
30
30
 
31
31
  def bootdisk_url(options)
32
- ForemanBootdisk::Engine.routes.url_for(options.merge(:only_path => true))
32
+ ForemanBootdisk::Engine.routes.url_for(options.merge(:only_path => true, :script_name => foreman_bootdisk_path))
33
33
  end
34
34
 
35
35
  def bootdisk_authorized_for(options)
@@ -4,7 +4,7 @@ module ForemanBootdisk::HostExt
4
4
  extend ActiveSupport::Concerns
5
5
 
6
6
  def bootdisk_template
7
- ConfigTemplate.find_by_name(Setting[:bootdisk_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_host_template'))
7
+ ProvisioningTemplate.find_by_name(Setting[:bootdisk_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_host_template'))
8
8
  end
9
9
 
10
10
  def bootdisk_template_render
@@ -6,11 +6,7 @@ module ForemanBootdisk
6
6
  include Rails.application.routes.url_helpers
7
7
 
8
8
  def generic_template_render
9
- if (Gem::Version.new(SETTINGS[:version].notag) < Gem::Version.new('1.5')) && Setting[:safemode_render]
10
- raise(::Foreman::Exception.new(N_('Bootdisk is not supported with safemode rendering, please disable safemode_render under Adminster>Settings')))
11
- end
12
-
13
- tmpl = ConfigTemplate.find_by_name(Setting[:bootdisk_generic_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_generic_host_template'))
9
+ tmpl = ProvisioningTemplate.find_by_name(Setting[:bootdisk_generic_host_template]) || raise(::Foreman::Exception.new(N_('Unable to find template specified by %s setting'), 'bootdisk_generic_host_template'))
14
10
  @host = Struct.new(:token, :subnet).new(nil, nil)
15
11
  unattended_render(tmpl.template)
16
12
  end
@@ -1,12 +1,20 @@
1
1
  class ChangeTemplatekindToBootdisk < ActiveRecord::Migration
2
+ class FakeConfigTemplate < ActiveRecord::Base
3
+ if ActiveRecord::Migrator.get_all_versions.include?(20150514072626)
4
+ self.table_name = 'templates'
5
+ else
6
+ self.table_name = 'config_templates'
7
+ end
8
+ end
9
+
2
10
  def self.up
3
11
  kind = TemplateKind.find_or_create_by_name('Bootdisk')
4
12
 
5
13
  tmpl_h = Setting.find_by_name('bootdisk_host_template').try(:value)
6
14
  tmpl_g = Setting.find_by_name('bootdisk_generic_host_template').try(:value)
7
15
 
8
- (ConfigTemplate.unscoped.where('name LIKE ?', '%Boot disk%') |
9
- ConfigTemplate.unscoped.where(:name => [tmpl_h, tmpl_g].compact)).each do |tmpl|
16
+ (FakeConfigTemplate.unscoped.where('name LIKE ?', '%Boot disk%') |
17
+ FakeConfigTemplate.unscoped.where(:name => [tmpl_h, tmpl_g].compact)).each do |tmpl|
10
18
  tmpl.update_attribute(:template_kind_id, kind.id)
11
19
  end
12
20
  end
@@ -15,7 +23,7 @@ class ChangeTemplatekindToBootdisk < ActiveRecord::Migration
15
23
  old_kind = TemplateKind.find_by_name('Bootdisk')
16
24
  new_kind = TemplateKind.find_by_name('iPXE')
17
25
  if old_kind.present? && new_kind.present?
18
- ConfigTemplate.unscoped.where(:template_kind_id => old_kind.id).update_all(:template_kind_id => new_kind.id)
26
+ FakeConfigTemplate.unscoped.where(:template_kind_id => old_kind.id).update_all(:template_kind_id => new_kind.id)
19
27
  end
20
28
  end
21
29
  end
@@ -1,8 +1,8 @@
1
1
  kind = TemplateKind.find_or_create_by_name('Bootdisk')
2
2
 
3
- ConfigTemplate.without_auditing do
3
+ ProvisioningTemplate.without_auditing do
4
4
  content = File.read(File.join(ForemanBootdisk::Engine.root, 'app', 'views', 'foreman_bootdisk', 'host.erb'))
5
- tmpl = ConfigTemplate.find_or_create_by_name(
5
+ tmpl = ProvisioningTemplate.find_or_create_by_name(
6
6
  :name => 'Boot disk iPXE - host',
7
7
  :template_kind_id => kind.id,
8
8
  :snippet => false,
@@ -17,7 +17,7 @@ ConfigTemplate.without_auditing do
17
17
  tmpl.save!(:validate => false) if tmpl.changes.present?
18
18
 
19
19
  content = File.read(File.join(ForemanBootdisk::Engine.root, 'app', 'views', 'foreman_bootdisk', 'generic_host.erb'))
20
- tmpl = ConfigTemplate.find_or_create_by_name(
20
+ tmpl = ProvisioningTemplate.find_or_create_by_name(
21
21
  :name => 'Boot disk iPXE - generic host',
22
22
  :template_kind_id => kind.id,
23
23
  :snippet => false,
@@ -28,7 +28,7 @@ module ForemanBootdisk
28
28
 
29
29
  initializer 'foreman_bootdisk.register_plugin', :after=> :finisher_hook do |app|
30
30
  Foreman::Plugin.register :foreman_bootdisk do
31
- requires_foreman '>= 1.8'
31
+ requires_foreman '>= 1.9'
32
32
 
33
33
  security_block :bootdisk do |map|
34
34
  permission :download_bootdisk, {:'foreman_bootdisk/disks' => [:generic, :host, :full_host, :help],
@@ -1,3 +1,3 @@
1
1
  module ForemanBootdisk
2
- VERSION = '5.0.0'
2
+ VERSION = '6.0.0'
3
3
  end
@@ -21,7 +21,8 @@ class ActionController::TestCase
21
21
 
22
22
  def setup_host
23
23
  disable_orchestration
24
- subnet = FactoryGirl.create(:subnet, :gateway => '10.0.1.254', :dns_primary => '8.8.8.8')
25
- @host = FactoryGirl.create(:host, :managed, :subnet => subnet, :ip => subnet.network.sub(/0$/, '4'))
24
+ org, loc = FactoryGirl.create(:organization), FactoryGirl.create(:location)
25
+ subnet = FactoryGirl.create(:subnet, :gateway => '10.0.1.254', :dns_primary => '8.8.8.8', :organizations => [org], :locations => [loc])
26
+ @host = FactoryGirl.create(:host, :managed, :subnet => subnet, :ip => subnet.network.sub(/0$/, '4'), :organization => org, :location => loc)
26
27
  end
27
28
  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: 5.0.0
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Cleal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-06-15 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.