foreman_bootdisk 11.0.0 → 12.0.0

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
  SHA256:
3
- metadata.gz: 7090fb0dd77db85fc9aa172b0a785f2d97c37a3dc5597a689a5c79fd7fbd0f2a
4
- data.tar.gz: d35862a0f641367cc7bfd1fa95a801e0ab5afd056b19995fa6f05aae97bf4bdd
3
+ metadata.gz: 208b518a4b2d0978e4ef072aab241305e16b327e4709f6bad1cfee39ffc7b85a
4
+ data.tar.gz: 758b6cba3dbeef8c95862aac8b4ded56c25e4d52224e15d962c538502baaec96
5
5
  SHA512:
6
- metadata.gz: c7c3a1e1f5e951b2252087d2064c9886a779a08c96a4c52d15c5d7711a542d5c9195e96bd86aecf2d82f780b633f11680c91368304d7874e8130b181e0f1606f
7
- data.tar.gz: 278854b3bcfbd844c72d0c817e1479d47a47125f95f47cb2b08b7dc257f0ece53f73070296681952c7bfeced060329e30033bf021a371420727b3b942461fb92
6
+ metadata.gz: 98b20bf6e7304aeae69d1bc5244681fea14b2d60e8d4ab32e0f6990c5f47c9985d96d1d1491188336a84ba42d25629ce3cfe74f0cbe6e6b4a0c5525fdd8e5e21
7
+ data.tar.gz: eb3b37f7b7846aeb5d4179fe5f0bb74183aa48376494c6dcf9aad05d8f8dd7767b38d5ebda1cbf7d9c2479fe8b5e4957a9df74b9d440ff46c8da4e482af535e0
data/CHANGES.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## v12.0.0
4
+ * fixed subnet image token stub (#22428)
5
+ * moved MAC based identification to Foreman core (#22858)
6
+ * bootdisk_raise fixed for host context (#22482)
7
+ * fixed nil exception with PXELinux template (#23267)
8
+
3
9
  ## v11.0.0
4
10
  * bootdisk_raise template marco works in preview mode (#22136)
5
11
  * host image works with subnet without gateway (#21106)
data/README.md CHANGED
@@ -46,6 +46,7 @@ gPXE images are unsupported due to lack of initrd support.
46
46
  | >= 1.13 | ~> 9.0 |
47
47
  | >= 1.15 | ~> 10.0 |
48
48
  | >= 1.17 | ~> 11.0 |
49
+ | >= 1.18 | ~> 12.0 |
49
50
 
50
51
  # Usage
51
52
 
@@ -10,10 +10,6 @@ module ForemanBootdisk::HostExt
10
10
  unattended_render(bootdisk_template.template)
11
11
  end
12
12
 
13
- def bootdisk_chain_url(mac = self.mac, action = 'iPXE')
14
- ForemanBootdisk::Renderer.format_bootdisk_chain_url(foreman_url(action), mac)
15
- end
16
-
17
13
  def bootdisk_build?
18
14
  provision_method == 'bootdisk'
19
15
  end
@@ -11,7 +11,10 @@ class ForemanBootdisk::ISOGenerator
11
11
  raise ::Foreman::Exception.new(N_('Host is not in build mode, so the template cannot be rendered')) unless host.build?
12
12
 
13
13
  tmpl = host.send(:generate_pxe_template, :PXELinux)
14
- raise ::Foreman::Exception.new(N_('Unable to generate disk template: %s'), host.errors.full_messages.to_sentence) if tmpl == false
14
+ unless tmpl
15
+ err = host.errors.full_messages.to_sentence
16
+ raise ::Foreman::Exception.new(N_('Unable to generate disk template, PXELinux template not found or: %s'), err)
17
+ end
15
18
 
16
19
  # pxe_files and filename conversion is utterly bizarre
17
20
  # aim to convert filenames to something usable under ISO 9660, update the template to match
@@ -13,9 +13,9 @@ module ForemanBootdisk
13
13
  if subnet.present?
14
14
  # rendering a subnet-level bootdisk requires tricking the renderer into thinking it has a
15
15
  # valid host, with a token, and with a tftp proxy
16
- @host = Struct.new(:token, :subnet).new(
16
+ @host = Struct.new(:token, :provision_interface).new(
17
17
  Struct.new(:value).new('faketoken'),
18
- subnet
18
+ Struct.new(:subnet).new(subnet)
19
19
  )
20
20
  else
21
21
  @host = Struct.new(:token, :subnet).new(nil,nil)
@@ -10,14 +10,18 @@ module ForemanBootdisk
10
10
  u.fragment = nil
11
11
  u.to_s
12
12
  end
13
+
14
+ def bootdisk_raise(*args)
15
+ raise ::Foreman::Exception.new(*args)
16
+ end
13
17
  end
14
18
 
15
- def bootdisk_chain_url(mac = '', action = 'iPXE')
19
+ def bootdisk_chain_url(mac = self.try(:mac), action = 'iPXE')
16
20
  self.class.format_bootdisk_chain_url(foreman_url(action), mac)
17
21
  end
18
22
 
19
23
  def bootdisk_raise(*args)
20
- raise ::Foreman::Exception.new(*args)
24
+ self.class.bootdisk_raise(*args)
21
25
  end
22
26
  end
23
27
  end
@@ -48,7 +48,7 @@ module ForemanBootdisk
48
48
 
49
49
  initializer 'foreman_bootdisk.register_plugin', :before => :finisher_hook do |app|
50
50
  Foreman::Plugin.register :foreman_bootdisk do
51
- requires_foreman '>= 1.17'
51
+ requires_foreman '>= 1.18'
52
52
 
53
53
  security_block :bootdisk do |map|
54
54
  permission :download_bootdisk, {:'foreman_bootdisk/disks' => [:generic, :host, :full_host, :subnet, :help],
@@ -77,9 +77,9 @@ module ForemanBootdisk
77
77
  config.to_prepare do
78
78
  begin
79
79
  Host::Managed.send(:prepend, ForemanBootdisk::HostExt)
80
+ Host::Managed.send(:include, ForemanBootdisk::RendererMethods)
80
81
  Host::Managed.send(:include, ForemanBootdisk::Orchestration::Compute) if SETTINGS[:unattended]
81
82
  HostsHelper.send(:prepend, ForemanBootdisk::HostsHelperExt)
82
- UnattendedController.send(:prepend, ForemanBootdisk::UnattendedControllerExt)
83
83
  Foreman::Model::Vmware.send(:prepend, ForemanBootdisk::ComputeResources::Vmware) if Foreman::Model::Vmware.available?
84
84
  rescue => e
85
85
  puts "#{ForemanBootdisk::ENGINE_NAME}: skipping engine hook (#{e.to_s})"
@@ -1,3 +1,3 @@
1
1
  module ForemanBootdisk
2
- VERSION = '11.0.0'
2
+ VERSION = '12.0.0'
3
3
  end
@@ -8,8 +8,8 @@ msgid ""
8
8
  msgstr ""
9
9
  "Project-Id-Version: foreman_bootdisk 1.0.0\n"
10
10
  "Report-Msgid-Bugs-To: \n"
11
- "POT-Creation-Date: 2017-12-01 14:36-0500\n"
12
- "PO-Revision-Date: 2017-12-01 14:36-0500\n"
11
+ "POT-Creation-Date: 2018-03-12 12:56-0400\n"
12
+ "PO-Revision-Date: 2018-03-12 12:56-0400\n"
13
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
15
  "Language: \n"
@@ -289,14 +289,6 @@ msgstr ""
289
289
  msgid "Host has no domain defined"
290
290
  msgstr ""
291
291
 
292
- #: ../app/views/foreman_bootdisk/host.erb:13
293
- msgid "Subnet (%s) has no gateway defined"
294
- msgstr ""
295
-
296
- #: ../app/views/foreman_bootdisk/host.erb:14
297
- msgid "Subnet (%s) has no primary DNS server defined"
298
- msgstr ""
299
-
300
292
  #: ../lib/foreman_bootdisk/engine.rb:65
301
293
  msgid "Boot disk based"
302
294
  msgstr ""
@@ -40,10 +40,9 @@ class ForemanBootdisk::IsoGeneratorTest < ActiveSupport::TestCase
40
40
  end
41
41
 
42
42
  test "full host image generation generates via PXELinux type" do
43
+ @host.expects(:generate_pxe_template).with(:PXELinux).returns("Template")
43
44
  @host.operatingsystem.expects(:pxe_files).returns([])
44
- @host.operatingsystem.expects(:kernel).returns("kernel")
45
- @host.operatingsystem.expects(:initrd).returns("initrd")
46
- ForemanBootdisk::ISOGenerator.expects(:generate).with({:isolinux => nil, :files => []}, anything)
45
+ ForemanBootdisk::ISOGenerator.expects(:generate).with({:isolinux => "Template", :files => []}, anything)
47
46
  ForemanBootdisk::ISOGenerator.generate_full_host(@host)
48
47
  end
49
48
  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: 11.0.0
4
+ version: 12.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: 2018-01-15 00:00:00.000000000 Z
11
+ date: 2018-05-29 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.
@@ -25,7 +25,6 @@ files:
25
25
  - LICENSE
26
26
  - README.md
27
27
  - app/assets/javascripts/foreman_bootdisk/host_edit.js
28
- - app/controllers/concerns/foreman_bootdisk/unattended_controller_ext.rb
29
28
  - app/controllers/foreman_bootdisk/api/v2/disks_controller.rb
30
29
  - app/controllers/foreman_bootdisk/api/v2/subnet_disks_controller.rb
31
30
  - app/controllers/foreman_bootdisk/disks_controller.rb
@@ -116,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
115
  version: '0'
117
116
  requirements: []
118
117
  rubyforge_project:
119
- rubygems_version: 2.7.3
118
+ rubygems_version: 2.7.6
120
119
  signing_key:
121
120
  specification_version: 4
122
121
  summary: Create boot disks to provision hosts with Foreman
@@ -1,6 +0,0 @@
1
- module ForemanBootdisk::UnattendedControllerExt
2
- def find_host_by_ip_or_mac
3
- request.env['HTTP_X_RHN_PROVISIONING_MAC_0'] = "unknown #{params['mac']}" unless request.env.has_key?('HTTP_X_RHN_PROVISIONING_MAC_0') || params['mac'].nil?
4
- super
5
- end
6
- end