beaker-answers 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2E3NGQwNjgwMWZjOWY1MDVjNWU3MWI5MjNmN2NhZDgzNjU5Mjk5ZA==
4
+ MzMxMWVjMjk1ZjE0YTUzNjk5OGM3NTRlNTg5MjE5NjRmYjZjMmE5MA==
5
5
  data.tar.gz: !binary |-
6
- ZmI5ODg4YWNhYTNkZmVhOTRjNDBiMjhkOThjNjZjMzU3MjVkMWU5Mg==
6
+ ZTRhOWUyN2E5NWVmMzU5ZWQyZGY5YTNhZTgzNjA3Zjg1OTY1OThjMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZGQ1MmM3ZTE1YTlhNTM0ZWY5OTFlMjNhN2JlZTM0OWNhNzMzZDJhZTllZDli
10
- YmMyYTVlZTBiMTQ3MTk4ZWQxOWRiYjhhMDdjYTNmZWIxZTVlNTcwZjlkMjgy
11
- YzhjODZjZGVhOTUzMjJkYjM4MzkyZjc2OTI0NTk3OTNkZGY3ZTU=
9
+ ZTlhZmM0NTVkODk1NzEyNDgwODczNzJkOGFmZjRmZmU5ZGFlMDAwNzQ5ODg4
10
+ NGUwYjUzMjk3YmJkMmZmNTgwNzhiNDdjMWJiMzNiZjU2NGQ1ZGRhYjZlMDI5
11
+ MjQ3YjdkM2I0NTljZThlZDc3ZmVmY2E3MTBkYjhmYzljNTlkODA=
12
12
  data.tar.gz: !binary |-
13
- MzczOWY2ZWJlY2Q5ZmU1NTViY2RkOTg0YjE0YTVkNDQwNGY3NGVkZWYzZTA5
14
- ZWM0ZmUxYTY5MmNlMzkzMmYzYmI2ODYzOTc4MDAzMDE5ZjQzZjRmNzQ5ZGM4
15
- YzExNDkyODY1OWIzYWIyMGYxNDM4NmM1NDNiYjE1YTY0ODAxYTc=
13
+ NTI5NDJjMzUwMzE2YjM0YTE0NDE4NWI5Y2Q3Y2IxOTQ3NDIzZDVmMzg0ZDJh
14
+ ZGY5ZTRjY2M0MjNkZDY4ZjMwM2MzODJkZjFmNzllMWFkMjIyZTk3NzU4NmQx
15
+ NTc2YzA1N2FjMTcwNzA1ZTJmZDk2MjBlZmY3ZTgxNGMyMGYwY2Y=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 28 Apr, 2016 (32ef620e)](#LATEST)
3
+ * [LATEST - 28 Apr, 2016 (331f9d3e)](#LATEST)
4
+ * [0.4.1 - 28 Apr, 2016 (d9d14510)](#0.4.1)
4
5
  * [0.4.0 - 12 Feb, 2016 (96d0d7cf)](#0.4.0)
5
6
  * [0.3.2 - 10 Nov, 2015 (f699c033)](#0.3.2)
6
7
  * [0.3.1 - 2 Nov, 2015 (e5922067)](#0.3.1)
@@ -11,7 +12,29 @@
11
12
  * [0.1.0 - 26 Aug, 2015 (ef47972d)](#0.1.0)
12
13
 
13
14
  ## Details
14
- ### <a name = "LATEST">LATEST - 28 Apr, 2016 (32ef620e)
15
+ ### <a name = "LATEST">LATEST - 28 Apr, 2016 (331f9d3e)
16
+
17
+ * (GEM) update beaker-answers version to 0.4.2 (331f9d3e)
18
+
19
+ * Merge pull request #13 from tvpartytonight/BKR-763 (0d363027)
20
+
21
+
22
+ ```
23
+ Merge pull request #13 from tvpartytonight/BKR-763
24
+
25
+ Revert "(BKR-763) Supply only necessary answers on upgrade"
26
+ ```
27
+ * Revert "(BKR-763) Supply only necessary answers on upgrade" (8647174a)
28
+
29
+
30
+ ```
31
+ Revert "(BKR-763) Supply only necessary answers on upgrade"
32
+
33
+ This reverts commit 5b1e9782de49e80fa3d02e0854626589791e6d26.
34
+ ```
35
+ ### <a name = "0.4.1">0.4.1 - 28 Apr, 2016 (d9d14510)
36
+
37
+ * (HISTORY) update beaker-answers history for gem release 0.4.1 (d9d14510)
15
38
 
16
39
  * (GEM) update beaker-answers version to 0.4.1 (32ef620e)
17
40
 
@@ -4,7 +4,6 @@ module BeakerAnswers
4
4
  class Answers
5
5
 
6
6
  DEFAULT_ANSWERS = StringifyHash.new.merge({
7
- :q_install => 'y',
8
7
  :q_puppet_enterpriseconsole_auth_user_email => 'admin@example.com',
9
8
  :q_puppet_enterpriseconsole_auth_password => '~!@#$%^*-/ aZ',
10
9
  :q_puppet_enterpriseconsole_smtp_port => 25,
@@ -48,12 +47,6 @@ module BeakerAnswers
48
47
  BeakerAnswers.constants.select {|c| BeakerAnswers.const_get(c).is_a?(Class) && BeakerAnswers.const_get(c).respond_to?(:pe_version_matcher)}
49
48
  end
50
49
 
51
- # Determine the list of supported upgrade PE versions, return as an array
52
- # @return [Array<String>] An array of the supported versions
53
- def self.supported_upgrade_versions
54
- BeakerAnswers.constants.select {|c| BeakerAnswers.const_get(c).is_a?(Class) && BeakerAnswers.const_get(c).respond_to?(:upgrade_version_matcher)}
55
- end
56
-
57
50
  # When given a Puppet Enterprise version, a list of hosts and other
58
51
  # qualifying data this method will return the appropriate object that can be used
59
52
  # to generate answer file data.
@@ -65,15 +58,6 @@ module BeakerAnswers
65
58
  # @return [Hash] A hash (keyed from hosts) containing hashes of answer file
66
59
  # data.
67
60
  def self.create version, hosts, options
68
- # if :upgrade is detected, then we return the simpler upgrade answers
69
- if options[:type] == :upgrade
70
- self.supported_upgrade_versions.each do |upgrade_version_class|
71
- if BeakerAnswers.const_get(upgrade_version_class).send(:upgrade_version_matcher) =~ version
72
- return BeakerAnswers.const_get(upgrade_version_class).send(:new, version, hosts, options)
73
- end
74
- end
75
- warn 'Only upgrades to version 3.8 and above generate specific upgrade answers. Defaulting to full answers.'
76
- end
77
61
 
78
62
  # finds all potential version classes
79
63
  # discovers new version classes as they are added, no more crazy case statement
@@ -1,5 +1,5 @@
1
1
  module BeakerAnswers
2
2
  module Version
3
- STRING = '0.4.1'
3
+ STRING = '0.4.2'
4
4
  end
5
5
  end
@@ -29,35 +29,6 @@ describe BeakerAnswers do
29
29
  end
30
30
  end
31
31
 
32
- context 'when we are upgrading to a version > 3.8' do
33
- supported_general_upgrade_versions = [ '2015.1.0',
34
- '2016.1.0',
35
- '2016.2.1']
36
- supported_general_upgrade_versions.each do |version|
37
- it "the version #{version} generates general upgrade answers" do
38
- @ver = version
39
- options[:type] = :upgrade
40
- expect( answers ).to be_a_kind_of BeakerAnswers::Upgrade
41
- end
42
- end
43
- end
44
-
45
- it 'generates upgrade38 answers when type is upgrade and the version 3.8' do
46
- @ver = '3.8.3'
47
- options[:type] = :upgrade
48
- expect( answers ).to be_a_kind_of BeakerAnswers::Upgrade38
49
- end
50
-
51
- it 'generates 2016.2 answers for 2016.2 hosts' do
52
- @ver = '2016.2.0'
53
- expect( answers ).to be_a_kind_of BeakerAnswers::Version20162
54
- end
55
-
56
- it 'generates 2016.1 answers for 2016.1 hosts' do
57
- @ver = '2016.1.0'
58
- expect( answers ).to be_a_kind_of BeakerAnswers::Version20161
59
- end
60
-
61
32
  it 'generates 2015.3 answers for 2015.3 hosts' do
62
33
  @ver = '2015.3.0'
63
34
  expect( answers ).to be_a_kind_of BeakerAnswers::Version20153
@@ -348,99 +319,6 @@ describe BeakerAnswers::Version40 do
348
319
  end
349
320
  end
350
321
 
351
- describe BeakerAnswers::Upgrade do
352
-
353
- let( :options ) { StringifyHash.new }
354
- let( :basic_hosts ) { make_hosts( {'pe_ver' => @ver } ) }
355
- let( :hosts ) { basic_hosts[0]['roles'] = ['master', 'agent']
356
- basic_hosts[1]['roles'] = ['dashboard', 'agent']
357
- basic_hosts[2]['roles'] = ['database', 'agent']
358
- basic_hosts }
359
- let( :answers ) { BeakerAnswers::Answers.create(@ver, hosts, options.merge({:type => :upgrade}) ) }
360
-
361
- before :each do
362
- @ver = '2015.3'
363
- @answers = answers.answers
364
- end
365
-
366
- context 'when per host custom answers are provided for the master and dashboard' do
367
- let( :hosts ) { basic_hosts[0]['roles'] = ['master', 'agent']
368
- basic_hosts[0][:custom_answers] = { :q_custom0 => '0LOOK' }
369
- basic_hosts[1]['roles'] = ['dashboard', 'agent']
370
- basic_hosts[1][:custom_answers] = { :q_custom1 => 'LOOKLOOK',
371
- :q_custom2 => "LOOK3"}
372
- basic_hosts[2]['roles'] = ['database', 'agent']
373
- basic_hosts }
374
-
375
- it 'adds those custom answers to the master' do
376
- expect( @answers['vm1'][:q_custom0] ).to be === '0LOOK'
377
- expect( @answers['vm1'][:q_install] ).to eq('y')
378
- expect( @answers['vm1'].size).to eq(2)
379
- end
380
-
381
- it 'adds custom answers to the dashboard' do
382
- expect( @answers['vm2'][:q_custom1] ).to be === 'LOOKLOOK'
383
- expect( @answers['vm2'][:q_custom2] ).to be === 'LOOK3'
384
- expect( @answers['vm2'][:q_install] ).to eq('y')
385
- expect( @answers['vm2'].size).to eq(3)
386
- end
387
-
388
- it 'does not add custom answers for the database' do
389
- expect(@answers['vm3'][:q_install]).to eq('y')
390
- expect(@answers['vm3'].length).to eq(1)
391
- end
392
- end
393
-
394
- context 'when no custom answers are provided' do
395
- it "each answer should have only one key for :q_install" do
396
- @answers.each do |vmname, answer|
397
- expect(answer[:q_install]).to eq('y')
398
- expect(answer.length).to eq(1)
399
- end
400
- end
401
- end
402
- end
403
-
404
- describe BeakerAnswers::Upgrade38 do
405
-
406
- let( :options ) { StringifyHash.new }
407
- let( :basic_hosts ) { make_hosts( {'pe_ver' => @ver } ) }
408
- let( :hosts ) { basic_hosts[0]['roles'] = ['master', 'agent']
409
- basic_hosts[1]['roles'] = ['dashboard', 'agent']
410
- basic_hosts[2]['roles'] = ['database', 'agent']
411
- basic_hosts }
412
- let( :answers ) { BeakerAnswers::Answers.create(@ver, hosts, options.merge({:type => :upgrade}) ) }
413
-
414
- before :each do
415
- @ver = '3.8'
416
- @answers = answers.answers
417
- end
418
-
419
- context 'when no special answers are provided' do
420
- it "each answer should have only two keys" do
421
- @answers.each do |vmname, answer|
422
- expect(answer[:q_install]).to eq('y')
423
- expect(answer[:q_enable_future_parser]).to eq('y')
424
- expect(answer.length).to eq(2)
425
- end
426
- end
427
- end
428
-
429
- context 'when we set :q_enable_future_parser in global options' do
430
- let( :options ) {
431
- options = StringifyHash.new
432
- options[:answers] = { :q_enable_future_parser => 'thefutureparser!!!'}
433
- options
434
- }
435
- it 'sets that parser option from the global options' do
436
- @answers.each do |vmname, answer|
437
- expect(answer[:q_enable_future_parser]).to eq('thefutureparser!!!')
438
- end
439
- end
440
-
441
- end
442
- end
443
-
444
322
  describe BeakerAnswers::Version20153 do
445
323
  let( :options ) { StringifyHash.new }
446
324
  let( :basic_hosts ) { make_hosts( {'pe_ver' => @ver } ) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-answers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-28 00:00:00.000000000 Z
12
+ date: 2016-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -186,8 +186,6 @@ files:
186
186
  - lib/beaker-answers.rb
187
187
  - lib/beaker-answers/answers.rb
188
188
  - lib/beaker-answers/version.rb
189
- - lib/beaker-answers/versions/upgrade.rb
190
- - lib/beaker-answers/versions/upgrade38.rb
191
189
  - lib/beaker-answers/versions/version20.rb
192
190
  - lib/beaker-answers/versions/version20153.rb
193
191
  - lib/beaker-answers/versions/version20161.rb
@@ -1,19 +0,0 @@
1
- module BeakerAnswers
2
- # In the case of upgrades, we lay down a much simpler file
3
- class Upgrade < Answers
4
-
5
- def self.upgrade_version_matcher
6
- /\A2015\.[123]|\A2016\.[1234]/
7
- end
8
-
9
- def generate_answers
10
- the_answers = {}
11
- @hosts.each do |host|
12
- the_answers[host.name] = {:q_install => answer_for(@options, :q_install)}
13
- # merge custom host answers if available
14
- the_answers[host.name] = the_answers[host.name].merge(host[:custom_answers]) if host[:custom_answers]
15
- end
16
- the_answers
17
- end
18
- end
19
- end
@@ -1,31 +0,0 @@
1
- module BeakerAnswers
2
- # In the case of upgrades, we lay down a much simpler file
3
- class Upgrade38 < Upgrade
4
-
5
- def self.upgrade_version_matcher
6
- /\A3\.8/
7
- end
8
-
9
- def generate_answers
10
- the_answers = super
11
- the_answers.map do |hostname, answers|
12
- # First check to see if there is a host option for this setting
13
- # and skip to the next object if it is already defined.
14
- if the_answers[hostname][:q_enable_future_parser]
15
- next
16
- # Check now if it was set in the global options.
17
- elsif @options[:answers] && @options[:answers][:q_enable_future_parser]
18
- the_answers[hostname][:q_enable_future_parser] = @options[:answers][:q_enable_future_parser]
19
- next
20
- # If we didn't set it on a per host or global option basis, set it to
21
- # 'y' here. We could have possibly set it in the DEFAULT_ANSWERS, but it
22
- # is unclear what kind of effect that might have on all the other answers
23
- # that rely on it defaulting to 'n'.
24
- else
25
- the_answers[hostname][:q_enable_future_parser] = 'y'
26
- end
27
- end
28
- the_answers
29
- end
30
- end
31
- end