beaker-hostgenerator 1.1.24 → 1.1.25

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: 39cc9b69e55fec84a0e797c023eb2de130440028
4
- data.tar.gz: 4638cce2af230c6f08b4994bd86efa116c1a34e9
3
+ metadata.gz: f9ec0f62cd53894b1235937709ff9b686cf33ae8
4
+ data.tar.gz: 317ffd0a1a70de086b6930a8f01f46385952f5ed
5
5
  SHA512:
6
- metadata.gz: b6b9b90eebfe07944114aacd7ac5b2afca33cde84289f261af07d82eeb0c5f4a845b37ba4563b524994e3ca1ebbc86247bbb0dfdf42ad8e7b1b032bdb85a74d8
7
- data.tar.gz: 54d974a389496923c57c2f0267d356423fcf7e3ec5122a00ca2edf5e82bd3dbf359e14a1f33ad2846229986a41d3ac099837117db23f4d6acab6b5eb8938c941
6
+ metadata.gz: 20812e4e1cd762ea6f4b3c4dfd15538bd49c24399cc13a4c3987aca1128c884aa65e48befc53ac36b5b8f54be2e4be2c16249ea53b9773d70dd1b5d6338bf566
7
+ data.tar.gz: 5df19f73742c052f280fb188a895d25a875464c6833be0091647532b89b59ed0405a25038154100cb06f581d6ff213fad27370d8aa6b4bc4c46a6dba9bde88a9
@@ -26,12 +26,8 @@ module BeakerHostGenerator
26
26
  # create.
27
27
  def self.create(node_info, options)
28
28
  name = node_info['host_settings']['hypervisor'] || options[:hypervisor]
29
- hypervisor = builtin_hypervisors[name]
30
- if hypervisor
31
- hypervisor.new
32
- else
33
- BeakerHostGenerator::Hypervisor::Unknown.new(name)
34
- end
29
+ hypervisor = builtin_hypervisors[name] || BeakerHostGenerator::Hypervisor::Unknown
30
+ hypervisor.new(name)
35
31
  end
36
32
 
37
33
  # Returns a map of all built-in hypervisor implementations, where the keys
@@ -54,6 +50,10 @@ module BeakerHostGenerator
54
50
  end
55
51
 
56
52
  class Interface
53
+ def initialize(name)
54
+ @name = name
55
+ end
56
+
57
57
  # Returns a map containing any general configuration required by this
58
58
  # hypervisor. This map will be merged into the 'CONFIG' section of the
59
59
  # final hosts configuration output.
@@ -88,6 +88,19 @@ module BeakerHostGenerator
88
88
  def generate_node(node_info, base_config, bhg_version)
89
89
  raise "Method 'generate_node' not implemented!"
90
90
  end
91
+
92
+ private
93
+
94
+ def base_generate_node(node_info, base_config, bhg_version, *hypervisors)
95
+ platform = node_info['platform']
96
+ hypervisors.map do |hypervisor|
97
+ base_config.deep_merge! get_platform_info(bhg_version, platform, hypervisor)
98
+ end
99
+
100
+ base_config['hypervisor'] = @name
101
+
102
+ return base_config
103
+ end
91
104
  end
92
105
  end
93
106
  end
@@ -15,21 +15,12 @@ module BeakerHostGenerator
15
15
  include BeakerHostGenerator::Data
16
16
 
17
17
  def generate_node(node_info, base_config, bhg_version)
18
- base_config['hypervisor'] = 'abs'
19
-
20
18
  # Grab vmpooler data for this platform and any hardware (ABS) data.
21
19
  # The assumption here is that these are mutually exclusive; that is,
22
20
  # any given platform will have *either* :vmpooler data or :abs data
23
21
  # so we're not worried about one overriding the other when we merge
24
22
  # the hashes together.
25
- platform = node_info['platform']
26
- vmpooler_platform_info = get_platform_info(bhg_version, platform, :vmpooler)
27
- abs_platform_info = get_platform_info(bhg_version, platform, :abs)
28
-
29
- base_config.deep_merge! vmpooler_platform_info
30
- base_config.deep_merge! abs_platform_info
31
-
32
- return base_config
23
+ return base_generate_node(node_info, base_config, bhg_version, :vmpooler, :abs)
33
24
  end
34
25
  end
35
26
  end
@@ -8,16 +8,11 @@ module BeakerHostGenerator
8
8
  include BeakerHostGenerator::Data
9
9
 
10
10
  def generate_node(node_info, base_config, bhg_version)
11
- base_config['hypervisor'] = 'docker'
12
11
  base_config['docker_cmd'] = ['/sbin/init']
13
12
  base_config['image'] = node_info['ostype'].sub(/(\d)/, ':\1')
14
13
  base_config['image'].sub!(/(\d{2})/, '\1.') if node_info['ostype'] =~ /^ubuntu/
15
14
 
16
- platform = node_info['platform']
17
- platform_info = get_platform_info(bhg_version, platform, :docker)
18
- base_config.deep_merge! platform_info
19
-
20
- return base_config
15
+ return base_generate_node(node_info, base_config, bhg_version, :docker)
21
16
  end
22
17
  end
23
18
  end
@@ -6,16 +6,8 @@ module BeakerHostGenerator::Hypervisor
6
6
  class Unknown < BeakerHostGenerator::Hypervisor::Interface
7
7
  include BeakerHostGenerator::Data
8
8
 
9
- def initialize(name)
10
- @name = name
11
- end
12
-
13
9
  def generate_node(node_info, base_config, bhg_version)
14
- platform = node_info['platform']
15
- general_info = get_platform_info(bhg_version, platform, :general)
16
- base_config.deep_merge! general_info
17
- base_config['hypervisor'] = @name
18
- return base_config
10
+ return base_generate_node(node_info, base_config, bhg_version, :general)
19
11
  end
20
12
  end
21
13
  end
@@ -8,8 +8,6 @@ module BeakerHostGenerator
8
8
  include BeakerHostGenerator::Data
9
9
 
10
10
  def generate_node(node_info, base_config, bhg_version)
11
- base_config['hypervisor'] = 'vagrant'
12
-
13
11
  if node_info['ostype'] =~ /^centos/
14
12
  base_config['box'] = node_info['ostype'].sub(/(\d)/, '/\1')
15
13
  elsif node_info['ostype'] =~ /^fedora/
@@ -21,11 +19,7 @@ module BeakerHostGenerator
21
19
  # We don't use this by default
22
20
  base_config['synced_folder'] = 'disabled'
23
21
 
24
- platform = node_info['platform']
25
- platform_info = get_platform_info(bhg_version, platform, :vagrant)
26
- base_config.deep_merge! platform_info
27
-
28
- return base_config
22
+ return base_generate_node(node_info, base_config, bhg_version, :vagrant)
29
23
  end
30
24
  end
31
25
  end
@@ -15,12 +15,7 @@ module BeakerHostGenerator
15
15
  end
16
16
 
17
17
  def generate_node(node_info, base_config, bhg_version)
18
- # set hypervisor
19
- base_config['hypervisor'] = 'vmpooler'
20
-
21
- platform = node_info['platform']
22
- platform_info = get_platform_info(bhg_version, platform, :vmpooler)
23
- base_config.deep_merge! platform_info
18
+ base_config = base_generate_node(node_info, base_config, bhg_version, :vmpooler)
24
19
 
25
20
  # Some vmpooler/vsphere platforms have special requirements.
26
21
  # We munge the node host config here if that is necessary.
@@ -1,5 +1,5 @@
1
1
  module BeakerHostGenerator
2
2
  module Version
3
- STRING = '1.1.24'
3
+ STRING = '1.1.25'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-hostgenerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.24
4
+ version: 1.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Branan Purvine-Riley
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-01-03 00:00:00.000000000 Z
13
+ date: 2019-01-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: minitest