master_manipulator 1.2.2 → 1.2.3

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
- YzAyZWVhZGE1MDE3NmJkNDU3MGNjMzE5NTBhNzA5YTEyOWIxYjk4Mg==
4
+ ZDJkYTZhZTY4Y2JjMjZlM2JlNWZhMmU4YWEwNzkwM2E2NzE3OWEzYw==
5
5
  data.tar.gz: !binary |-
6
- NjYyZjRiODNhNGU3YWRkNGE5ZmMwOWEwY2ZhNGJiOTQxZWUyYmQyMg==
6
+ ZDZkMzI5MjdiMTVlNGVkZmU2NDY4Zjk2MDhlNDIzMDJkNmIzODRmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjkyN2NkNDViOGYwMmFlMWVmYjNmNGNmMzA3ZGIzOGQ3MDUzM2UyOTZkYjE2
10
- ODZlYzQyYzk0MWYyMmUxYTYyMjM3Y2U1MzgxMDcwMjBlNTk5ZTZjZTEyNjI4
11
- ZTUwNDA5NDdjNmMyZGU3ZWM3ZmMzZjM4MWNkZTc0MTQwZTI2NWM=
9
+ NjY3NDBjZjU2ZjkzZjc0YjkxMDhiNDU0Nzg2MjA2NGJiNjRlYjRmODAwY2Q5
10
+ ZmZiMzFhNzNmZjdlZTE5MWYzNjExODMxNzQ2ZGJkN2Y0MWEyZTIyYWU1NzM3
11
+ YWJkZjk0ZTI3ZTM5NjhlNDE4ODMxZGE2MDkyZGMwMmRmNjQzM2Q=
12
12
  data.tar.gz: !binary |-
13
- YzcwNzcyYjNiMzYxMzYzNWM4M2VhM2VjNTY3NmU1YWE0OTgyMjU1ZjJhZDAz
14
- YTU0NzI3YjIxMmViNjc3NjNjMzlmMTkxYjk4NThjZTVhOWQ2ZTlkZmM1Y2Jm
15
- N2MxNGE3NTBmODJjNGRkNGFjNTE3MTk2OTVmMDRiZWY2M2Q0M2U=
13
+ MmM3ODdlMTQyYmIxMzRhNTNjYWNiZGY0YjBlOTllNjVlMTVmNWEwZmE3OGQ3
14
+ YjY5NmE2ZjNhMDgwNWY3MzEwN2UyMjU5ZmRiNTRlYjE4ZTA1ZmQzMTcyNDhi
15
+ YWU3ZDZkZDVkZTQxYTczYWIzOTUwNGEyMjkyN2EyMTBlYzA0NmY=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- master_manipulator (1.2.2)
4
+ master_manipulator (1.2.3)
5
5
  beaker (~> 2.7, >= 2.7.0)
6
6
  multi_json
7
7
 
@@ -9,7 +9,7 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  CFPropertyList (2.3.2)
12
- activesupport (4.2.4)
12
+ activesupport (4.2.5)
13
13
  i18n (~> 0.7)
14
14
  json (~> 1.7, >= 1.7.7)
15
15
  minitest (~> 5.1)
@@ -25,13 +25,13 @@ GEM
25
25
  aws-sdk-v1 (1.66.0)
26
26
  json (~> 1.4)
27
27
  nokogiri (>= 1.4.4)
28
- beaker (2.27.0)
28
+ beaker (2.29.0)
29
29
  aws-sdk (~> 1.57)
30
30
  beaker-answers (~> 0.0)
31
31
  beaker-hiera (~> 0.0)
32
32
  docker-api
33
33
  fission (~> 0.4)
34
- fog (~> 1.25)
34
+ fog (~> 1.25, < 1.35.0)
35
35
  fog-google (~> 0.0.9)
36
36
  google-api-client (~> 0.8)
37
37
  hocon (~> 0.1)
@@ -45,7 +45,7 @@ GEM
45
45
  rsync (~> 1.0.9)
46
46
  stringify-hash (~> 0.0)
47
47
  unf (~> 0.1)
48
- beaker-answers (0.3.0)
48
+ beaker-answers (0.3.2)
49
49
  require_all (~> 1.3.2)
50
50
  stringify-hash (~> 0.0.0)
51
51
  beaker-hiera (0.1.1)
@@ -54,7 +54,7 @@ GEM
54
54
  coderay (1.1.0)
55
55
  diff-lcs (1.2.5)
56
56
  docile (1.1.5)
57
- docker-api (1.22.4)
57
+ docker-api (1.23.0)
58
58
  excon (>= 0.38.0)
59
59
  json
60
60
  excon (0.45.4)
@@ -99,13 +99,11 @@ GEM
99
99
  fog-core (~> 1.22)
100
100
  fog-json
101
101
  inflecto (~> 0.0.2)
102
- fog-core (1.32.1)
102
+ fog-core (1.34.0)
103
103
  builder
104
104
  excon (~> 0.45)
105
105
  formatador (~> 0.2)
106
106
  mime-types
107
- net-scp (~> 1.1)
108
- net-ssh (>= 2.1.3)
109
107
  fog-dynect (0.0.2)
110
108
  fog-core
111
109
  fog-json
@@ -138,13 +136,13 @@ GEM
138
136
  fog-core
139
137
  fog-json
140
138
  fog-xml
141
- fog-sakuracloud (1.3.3)
139
+ fog-sakuracloud (1.4.0)
142
140
  fog-core
143
141
  fog-json
144
142
  fog-serverlove (0.1.2)
145
143
  fog-core
146
144
  fog-json
147
- fog-softlayer (1.0.1)
145
+ fog-softlayer (1.0.2)
148
146
  fog-core
149
147
  fog-json
150
148
  fog-storm_on_demand (0.1.1)
@@ -204,13 +202,13 @@ GEM
204
202
  method_source (0.8.2)
205
203
  mime-types (2.6.2)
206
204
  mini_portile (0.6.2)
207
- minitest (5.8.2)
205
+ minitest (5.8.3)
208
206
  multi_json (1.11.2)
209
207
  multipart-post (2.0.0)
210
208
  net-scp (1.2.1)
211
209
  net-ssh (>= 2.6.5)
212
210
  net-ssh (2.9.2)
213
- nokogiri (1.6.6.2)
211
+ nokogiri (1.6.6.4)
214
212
  mini_portile (~> 0.6.0)
215
213
  open_uri_redirections (0.2.1)
216
214
  props (1.1.2)
@@ -225,19 +223,19 @@ GEM
225
223
  trollop
226
224
  require_all (1.3.3)
227
225
  retriable (1.4.1)
228
- rspec (3.3.0)
229
- rspec-core (~> 3.3.0)
230
- rspec-expectations (~> 3.3.0)
231
- rspec-mocks (~> 3.3.0)
232
- rspec-core (3.3.2)
233
- rspec-support (~> 3.3.0)
234
- rspec-expectations (3.3.1)
226
+ rspec (3.4.0)
227
+ rspec-core (~> 3.4.0)
228
+ rspec-expectations (~> 3.4.0)
229
+ rspec-mocks (~> 3.4.0)
230
+ rspec-core (3.4.1)
231
+ rspec-support (~> 3.4.0)
232
+ rspec-expectations (3.4.0)
235
233
  diff-lcs (>= 1.2.0, < 2.0)
236
- rspec-support (~> 3.3.0)
237
- rspec-mocks (3.3.2)
234
+ rspec-support (~> 3.4.0)
235
+ rspec-mocks (3.4.0)
238
236
  diff-lcs (>= 1.2.0, < 2.0)
239
- rspec-support (~> 3.3.0)
240
- rspec-support (3.3.0)
237
+ rspec-support (~> 3.4.0)
238
+ rspec-support (3.4.1)
241
239
  rsync (1.0.9)
242
240
  rubyzip (1.1.7)
243
241
  signet (0.6.1)
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 30 Oct, 2015 (58720b61)](#LATEST)
3
+ * [LATEST - 20 Nov, 2015 (b37806b8)](#LATEST)
4
+ * [1.2.2 - 30 Oct, 2015 (31450d3c)](#1.2.2)
4
5
  * [1.2.1 - 30 Oct, 2015 (b59fd2cf)](#1.2.1)
5
6
  * [1.2.0 - 29 Oct, 2015 (6d0873f7)](#1.2.0)
6
7
  * [1.1.2 - 14 Jul, 2015 (13e5bb62)](#1.1.2)
@@ -10,7 +11,27 @@
10
11
  * [1.0.0 - 6 May, 2015 (8ae50d90)](#1.0.0)
11
12
 
12
13
  ## Details
13
- ### <a name = "LATEST">LATEST - 30 Oct, 2015 (58720b61)
14
+ ### <a name = "LATEST">LATEST - 20 Nov, 2015 (b37806b8)
15
+
16
+ * (GEM) update master_manipulator version to 1.2.3 (b37806b8)
17
+
18
+ * Merge pull request #16 from zreichert/make_master_manipulator_3.8_compatible (9d2073ff)
19
+
20
+
21
+ ```
22
+ Merge pull request #16 from zreichert/make_master_manipulator_3.8_compatible
23
+
24
+ (QA-2182) make restart_puppet_server 3.8 compatible
25
+ ```
26
+ * Address comments and fix spec tests (96d82bd4)
27
+
28
+ * add method for determining pe_version (c2b9a957)
29
+
30
+ * (QA-2182) make restart_puppet_server 3.8 compatible (9444b681)
31
+
32
+ ### <a name = "1.2.2">1.2.2 - 30 Oct, 2015 (31450d3c)
33
+
34
+ * (HISTORY) update master_manipulator history for gem release 1.2.2 (31450d3c)
14
35
 
15
36
  * (GEM) update master_manipulator version to 1.2.2 (58720b61)
16
37
 
@@ -27,16 +27,28 @@ module MasterManipulator
27
27
  hostname = on(host, 'hostname').stdout.chomp
28
28
  opts[:wait_cycles] ||= 10
29
29
 
30
- # -k to ignore HTTPS error that isn't relevant to us
31
- curl_call = "-k -X GET -H 'Content-Type: application/json' https://#{hostname}:8140/status/v1/services?level=debug"
30
+ pe_ver = pe_version(host)
31
+ three_eight_regex = /^3\.8/
32
+
33
+ # This logic is not ideal refactor in the future
34
+ # if its PE and not 3.8 use the status endpoint
35
+ # it its not PE or it is 3.8 use the simple curl call
36
+ if pe_ver && !pe_ver.match(three_eight_regex)
37
+ curl_call = "-k -X GET -H 'Content-Type: application/json' https://#{hostname}:8140/status/v1/services?level=debug"
38
+ else
39
+ curl_call = "-I -k https://#{hostname}:8140"
40
+ end
32
41
 
33
42
  (1..opts[:wait_cycles]).each do |i|
43
+
34
44
  @result = curl_on(host, curl_call, :acceptable_exit_codes => [0,1,7])
35
- @body = JSON.parse(@result.stdout)
45
+ # parse body if we are using PE and we are not in PE 3.8
46
+ (pe_ver && !pe_ver.match(three_eight_regex)) ? @body = JSON.parse(@result.stdout) : @body = []
47
+
36
48
  case @result.exit_code.to_s
37
49
  when '0'
38
50
  sleep 20
39
- return if @body.all?{ |k, v| v['state'] == 'running' }
51
+ pe_ver.match(/three_eight_regex/) ? return : (return if @body.all? { |k, v| v['state'] == 'running' })
40
52
  when '1', '7'
41
53
  # Exit code 7 is "connection refused"
42
54
  sleep (i**(1.2))
@@ -57,5 +69,27 @@ module MasterManipulator
57
69
 
58
70
  end
59
71
 
72
+ # Determine the version of PE installed on the master
73
+ #
74
+ # ==== Attributes
75
+ # *+host+ - the host that this should operate on
76
+ #
77
+ # ==== Returns
78
+ #
79
+ # +string+ -The version of puppet enterprise, if version can not be determined 'version unknown' is returned
80
+ #
81
+ # ==== Examples
82
+ #
83
+ # pe_version
84
+ def pe_version(host)
85
+ if on(host, 'test -f /opt/puppet/pe_version', :acceptable_exit_codes => [0,1]).exit_code == 0
86
+ return on(host, 'cat /opt/puppet/pe_version').stdout.chomp
87
+ elsif on(host, 'test -f /opt/puppetlabs/server/pe_version', :acceptable_exit_codes => [0,1]).exit_code == 0
88
+ return on(host, 'cat /opt/puppetlabs/server/pe_version').stdout.chomp
89
+ else
90
+ return 'version unknown'
91
+ end
92
+ end
93
+
60
94
  end
61
95
  end
@@ -1,5 +1,5 @@
1
1
  module MasterManipulator
2
2
  module Version
3
- STRING = '1.2.2'
3
+ STRING = '1.2.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_manipulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-30 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler