master_manipulator 1.1.2 → 1.2.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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 82c90ccb9f7a1f77f034cb73f4c8d758d961cf34
4
- data.tar.gz: 8547f78eb24085267afec5fd669d6be03acb3a38
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjI2Mzg2MzgxYTFkZDU4NWNiNTJlZWY4MDFlYmZkYWM0NjY3Mjc0NA==
5
+ data.tar.gz: !binary |-
6
+ M2E0ZGQyYjY1YzFmZDlmODg3MmY0YzU2ZTkzYTU1M2NlZjhhMGRkNw==
5
7
  SHA512:
6
- metadata.gz: 2ed736250d0ed64c218ede0274677eaa01b08079167f10f661a762aff0724f6285181e65326a3f777189bf7991bc4580abe47560c3409957f17c0595f83c364e
7
- data.tar.gz: fa9927b9a7bd56d6a98ad6c1741c6eedd5415abb73544f0e756111d2691c7b1501a7e13ccf99163ea68dd2d5e31576792456d8b688f6223fd1df1330a743adf1
8
+ metadata.gz: !binary |-
9
+ YTI4M2Y5ZmNiZjMxZWE1NDczNTAxYjk4MzQ0YzI4OWM4ODczODcyYjI5OWMy
10
+ ODc4OGQ0NGVlNWQ0NDZiNWI0OWE5M2Q0YjM4YTFmMmZjYmY1YjE1ZDAzZWNk
11
+ MzUyOGViMmIxYTRlODQ1MTY0ODNiYjc0ZDEzZDg4OTBmMjBjZDk=
12
+ data.tar.gz: !binary |-
13
+ Y2JjYTM0Y2ZlNjVlMzkyMTE1ZTI0ZTZlYTYzYjRlZGMyMTliODIyMzA0YmEy
14
+ MGU5YmRhOWNiODNlM2UxNTExNGY5NGNlMjE2ODY0MDdiZDRmMjA2NTlmNDJl
15
+ MjQyZjE3MTY3YzIxMWUwZWZjNDk0MzkwZTU0NTdiM2I5YTYyNzg=
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- master_manipulator (1.1.2)
4
+ master_manipulator (1.2.0)
5
5
  beaker (~> 2.7, >= 2.7.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- CFPropertyList (2.3.1)
11
- activesupport (4.2.3)
10
+ CFPropertyList (2.3.2)
11
+ activesupport (4.2.4)
12
12
  i18n (~> 0.7)
13
13
  json (~> 1.7, >= 1.7.7)
14
14
  minitest (~> 5.1)
@@ -19,16 +19,19 @@ GEM
19
19
  addressable (>= 2.3.1)
20
20
  extlib (>= 0.9.15)
21
21
  multi_json (>= 1.0.0)
22
- aws-sdk (1.64.0)
23
- aws-sdk-v1 (= 1.64.0)
24
- aws-sdk-v1 (1.64.0)
22
+ aws-sdk (1.66.0)
23
+ aws-sdk-v1 (= 1.66.0)
24
+ aws-sdk-v1 (1.66.0)
25
25
  json (~> 1.4)
26
26
  nokogiri (>= 1.4.4)
27
- beaker (2.18.0)
27
+ beaker (2.27.0)
28
28
  aws-sdk (~> 1.57)
29
+ beaker-answers (~> 0.0)
30
+ beaker-hiera (~> 0.0)
29
31
  docker-api
30
32
  fission (~> 0.4)
31
33
  fog (~> 1.25)
34
+ fog-google (~> 0.0.9)
32
35
  google-api-client (~> 0.8)
33
36
  hocon (~> 0.1)
34
37
  inifile (~> 2.0)
@@ -39,26 +42,33 @@ GEM
39
42
  open_uri_redirections (~> 0.2.1)
40
43
  rbvmomi (~> 1.8)
41
44
  rsync (~> 1.0.9)
45
+ stringify-hash (~> 0.0)
42
46
  unf (~> 0.1)
47
+ beaker-answers (0.3.0)
48
+ require_all (~> 1.3.2)
49
+ stringify-hash (~> 0.0.0)
50
+ beaker-hiera (0.1.1)
51
+ stringify-hash (~> 0.0.0)
43
52
  builder (3.2.2)
44
53
  coderay (1.1.0)
45
54
  diff-lcs (1.2.5)
46
55
  docile (1.1.5)
47
- docker-api (1.21.4)
56
+ docker-api (1.22.4)
48
57
  excon (>= 0.38.0)
49
58
  json
50
59
  excon (0.45.4)
51
60
  extlib (0.9.16)
52
- faraday (0.9.1)
61
+ faraday (0.9.2)
53
62
  multipart-post (>= 1.2, < 3)
54
63
  fission (0.5.0)
55
64
  CFPropertyList (~> 2.2)
56
- fog (1.32.0)
65
+ fog (1.34.0)
57
66
  fog-atmos
58
67
  fog-aws (>= 0.6.0)
59
68
  fog-brightbox (~> 0.4)
60
69
  fog-core (~> 1.32)
61
- fog-ecloud (= 0.1.1)
70
+ fog-dynect (~> 0.0.2)
71
+ fog-ecloud (~> 0.1)
62
72
  fog-google (>= 0.0.2)
63
73
  fog-json
64
74
  fog-local
@@ -79,26 +89,30 @@ GEM
79
89
  fog-atmos (0.1.0)
80
90
  fog-core
81
91
  fog-xml
82
- fog-aws (0.7.3)
92
+ fog-aws (0.7.6)
83
93
  fog-core (~> 1.27)
84
94
  fog-json (~> 1.0)
85
95
  fog-xml (~> 0.1)
86
96
  ipaddress (~> 0.8)
87
- fog-brightbox (0.7.2)
97
+ fog-brightbox (0.9.0)
88
98
  fog-core (~> 1.22)
89
99
  fog-json
90
100
  inflecto (~> 0.0.2)
91
- fog-core (1.32.0)
101
+ fog-core (1.32.1)
92
102
  builder
93
103
  excon (~> 0.45)
94
104
  formatador (~> 0.2)
95
105
  mime-types
96
106
  net-scp (~> 1.1)
97
107
  net-ssh (>= 2.1.3)
98
- fog-ecloud (0.1.1)
108
+ fog-dynect (0.0.2)
109
+ fog-core
110
+ fog-json
111
+ fog-xml
112
+ fog-ecloud (0.3.0)
99
113
  fog-core
100
114
  fog-xml
101
- fog-google (0.0.7)
115
+ fog-google (0.0.9)
102
116
  fog-core
103
117
  fog-json
104
118
  fog-xml
@@ -111,7 +125,7 @@ GEM
111
125
  fog-core (~> 1.27)
112
126
  fog-json (~> 1.0)
113
127
  fog-xml (~> 0.1)
114
- fog-profitbricks (0.0.3)
128
+ fog-profitbricks (0.0.5)
115
129
  fog-core
116
130
  fog-xml
117
131
  nokogiri
@@ -123,13 +137,13 @@ GEM
123
137
  fog-core
124
138
  fog-json
125
139
  fog-xml
126
- fog-sakuracloud (1.0.1)
140
+ fog-sakuracloud (1.3.3)
127
141
  fog-core
128
142
  fog-json
129
143
  fog-serverlove (0.1.2)
130
144
  fog-core
131
145
  fog-json
132
- fog-softlayer (0.4.7)
146
+ fog-softlayer (1.0.1)
133
147
  fog-core
134
148
  fog-json
135
149
  fog-storm_on_demand (0.1.1)
@@ -159,24 +173,24 @@ GEM
159
173
  multi_json (~> 1.10)
160
174
  retriable (~> 1.4)
161
175
  signet (~> 0.6)
162
- googleauth (0.4.1)
176
+ googleauth (0.4.2)
163
177
  faraday (~> 0.9)
164
178
  jwt (~> 1.4)
165
179
  logging (~> 2.0)
166
180
  memoist (~> 0.12)
167
- multi_json (= 1.11)
181
+ multi_json (~> 1.11)
168
182
  signet (~> 0.6)
169
- hocon (0.9.2)
183
+ hocon (0.9.3)
170
184
  i18n (0.7.0)
171
185
  inflecto (0.0.2)
172
186
  inifile (2.0.2)
173
187
  ipaddress (0.8.0)
174
188
  json (1.8.3)
175
- jwt (1.5.1)
176
- kramdown (1.8.0)
189
+ jwt (1.5.2)
190
+ kramdown (1.9.0)
177
191
  launchy (2.4.3)
178
192
  addressable (~> 2.3)
179
- little-plugger (1.1.3)
193
+ little-plugger (1.1.4)
180
194
  logging (2.0.0)
181
195
  little-plugger (~> 1.1)
182
196
  multi_json (~> 1.10)
@@ -187,10 +201,10 @@ GEM
187
201
  textutils (>= 0.2.0)
188
202
  memoist (0.12.0)
189
203
  method_source (0.8.2)
190
- mime-types (2.6.1)
204
+ mime-types (2.6.2)
191
205
  mini_portile (0.6.2)
192
- minitest (5.7.0)
193
- multi_json (1.11.0)
206
+ minitest (5.8.2)
207
+ multi_json (1.11.2)
194
208
  multipart-post (2.0.0)
195
209
  net-scp (1.2.1)
196
210
  net-ssh (>= 2.6.5)
@@ -208,17 +222,18 @@ GEM
208
222
  builder
209
223
  nokogiri (>= 1.4.1)
210
224
  trollop
225
+ require_all (1.3.3)
211
226
  retriable (1.4.1)
212
227
  rspec (3.3.0)
213
228
  rspec-core (~> 3.3.0)
214
229
  rspec-expectations (~> 3.3.0)
215
230
  rspec-mocks (~> 3.3.0)
216
- rspec-core (3.3.1)
231
+ rspec-core (3.3.2)
217
232
  rspec-support (~> 3.3.0)
218
- rspec-expectations (3.3.0)
233
+ rspec-expectations (3.3.1)
219
234
  diff-lcs (>= 1.2.0, < 2.0)
220
235
  rspec-support (~> 3.3.0)
221
- rspec-mocks (3.3.1)
236
+ rspec-mocks (3.3.2)
222
237
  diff-lcs (>= 1.2.0, < 2.0)
223
238
  rspec-support (~> 3.3.0)
224
239
  rspec-support (3.3.0)
@@ -236,6 +251,7 @@ GEM
236
251
  simplecov-html (~> 0.10.0)
237
252
  simplecov-html (0.10.0)
238
253
  slop (3.6.0)
254
+ stringify-hash (0.0.2)
239
255
  textutils (1.3.1)
240
256
  activesupport
241
257
  logutils (>= 0.6.1)
@@ -262,6 +278,3 @@ DEPENDENCIES
262
278
  rspec (>= 3.0.0)
263
279
  simplecov
264
280
  yard (~> 0)
265
-
266
- BUNDLED WITH
267
- 1.10.5
data/HISTORY.md CHANGED
@@ -1,12 +1,75 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 1 Jul, 2015 (14ceb0e8)](#LATEST)
3
+ * [LATEST - 29 Oct, 2015 (4be0bec7)](#LATEST)
4
+ * [1.1.2 - 14 Jul, 2015 (13e5bb62)](#1.1.2)
5
+ * [1.1.1 - 1 Jul, 2015 (42e15400)](#1.1.1)
4
6
  * [1.1.0 - 30 Jun, 2015 (c33bac06)](#1.1.0)
5
7
  * [1.0.1 - 17 Jun, 2015 (33c2182d)](#1.0.1)
6
8
  * [1.0.0 - 6 May, 2015 (8ae50d90)](#1.0.0)
7
9
 
8
10
  ## Details
9
- ### <a name = "LATEST">LATEST - 1 Jul, 2015 (14ceb0e8)
11
+ ### <a name = "LATEST">LATEST - 29 Oct, 2015 (4be0bec7)
12
+
13
+ * (GEM) update master_manipulator version to 1.2.0 (4be0bec7)
14
+
15
+ * Merge pull request #13 from zreichert/improvement/master/QA-2115-use_status_enpoint (8ef7e82b)
16
+
17
+
18
+ ```
19
+ Merge pull request #13 from zreichert/improvement/master/QA-2115-use_status_enpoint
20
+
21
+ (QA-2115) use services endpoint for puppetserver
22
+ ```
23
+ * (QA-2115) use services endpoint for puppetserver (ef2ebfc7)
24
+
25
+ ### <a name = "1.1.2">1.1.2 - 14 Jul, 2015 (13e5bb62)
26
+
27
+ * Merge pull request #12 from mckern/master (13e5bb62)
28
+
29
+
30
+ ```
31
+ Merge pull request #12 from mckern/master
32
+
33
+ (MAINT) Bump version to 1.1.2 for first public release
34
+ ```
35
+ * (MAINT) Bump version to 1.1.2 for first public release (8bd83fe9)
36
+
37
+ * Merge pull request #11 from mckern/master (be4bf542)
38
+
39
+
40
+ ```
41
+ Merge pull request #11 from mckern/master
42
+
43
+ (MAINT) Prepare Gemspec for initial public release
44
+ ```
45
+ * (MAINT) Prepare Gemspec for initial public release (0016defd)
46
+
47
+
48
+ ```
49
+ (MAINT) Prepare Gemspec for initial public release
50
+
51
+ Updated Gemspec to newer general Ruby and Rubygem standards
52
+ (http://guides.rubygems.org/specification-reference/), which includes:
53
+
54
+ Use single-quoted strings instead of double-string when interpolation
55
+ isn't needed.
56
+
57
+ Provide a slightly better description.
58
+
59
+ Update the Gem author with the same 'author' as our other public gems.
60
+
61
+ Correct OSI license name
62
+ (http://opensource.org/licenses/alphabetical).
63
+
64
+ Use Ruby to generate the files to package, instead of shelling out to
65
+ git on the command line.
66
+
67
+ Removing attributes that are unused, like spec.executables and
68
+ spec.require_paths (since it defaults to 'lib/').
69
+ ```
70
+ ### <a name = "1.1.1">1.1.1 - 1 Jul, 2015 (42e15400)
71
+
72
+ * (HISTORY) update master_manipulator history for gem release 1.1.1 (42e15400)
10
73
 
11
74
  * (GEM) update master_manipulator version to 1.1.1 (14ceb0e8)
12
75
 
@@ -1,3 +1,5 @@
1
+ require 'JSON'
2
+
1
3
  module MasterManipulator
2
4
  module Service
3
5
 
@@ -5,44 +7,52 @@ module MasterManipulator
5
7
  # ==== Attributes
6
8
  # *+host+ - the host that this should operate on
7
9
  # *+opts+ - an options hash - not required
8
- # *+:timeout+ - the amount of time in seconds to wait for success
9
- # *+:frequency+ - The time to wait between retries
10
+ # *+:wait_cycle+ - the number of cycles to attempt retry
10
11
  # *+:is_pe?+ - Boolean : if the SUT is PE, defaults to true
11
12
  #
12
13
  # Raises a standard error if the wait is unsuccessful
13
14
  #
14
15
  # ==== Example
15
16
  # restart_puppet_server(master)
16
- # restart_puppet_server(master, {:time_out => 200, :frequency => 10})
17
+ # restart_puppet_server(master, {:wait_cycles => 20})
17
18
  def restart_puppet_server(host, opts = {})
18
19
 
20
+ start_time = Time.now
21
+
19
22
  opts[:is_pe?] ||= true
20
23
  opts[:is_pe?] ? service_name = 'pe-puppetserver' : service_name = 'puppetserver'
21
24
 
22
25
  on(host, puppet("resource service #{service_name} ensure=stopped"))
23
26
  on(host, puppet("resource service #{service_name} ensure=running"))
24
- masterHostName = on(host, 'hostname').stdout.chomp
25
- opts[:time_out] ||= 60
26
- opts[:frequency] ||= 5
27
- i = 0
27
+ hostname = on(host, 'hostname').stdout.chomp
28
+ opts[:wait_cycles] ||= 10
28
29
 
29
30
  # -k to ignore HTTPS error that isn't relevant to us
30
- curl_call = "-I -k https://#{masterHostName}:8140"
31
+ curl_call = "-k -X GET -H 'Content-Type: application/json' https://#{hostname}:8140/status/v1/services?level=debug"
31
32
 
32
- while i < opts[:time_out] do
33
- i += 1
34
- exit_code = curl_on(host, curl_call, :acceptable_exit_codes => [0,1,7]).exit_code
35
- case exit_code.to_s
33
+ (1..opts[:wait_cycles]).each do |i|
34
+ @result = curl_on(host, curl_call, :acceptable_exit_codes => [0,1,7])
35
+ @body = JSON.parse(@result.stdout)
36
+ case @result.exit_code.to_s
36
37
  when '0'
37
38
  sleep 20
38
- return
39
- when '1' || '7'
39
+ return if @body.all?{ |k, v| v['state'] == 'running' }
40
+ when '1', '7'
40
41
  # Exit code 7 is "connection refused"
41
- sleep opts[:frequency]
42
+ sleep (i**(1.2))
42
43
  end
43
44
  end
44
45
 
45
- message = "Attempted to restart #{i} times, waited #{opts[:frequency]} seconds between attempts."
46
+ total_time = Time.now - start_time
47
+
48
+ message = "Attempted to restart #{opts[:wait_cycles]} times, waited #{total_time} seconds total."
49
+
50
+ message << "\nHere is the status reported by the puppetserver'"
51
+
52
+ @body.each do |k,v|
53
+ message << "\n'#{k}' state: #{v['state']} "
54
+ end
55
+
46
56
  raise message
47
57
 
48
58
  end
@@ -1,5 +1,5 @@
1
1
  module MasterManipulator
2
2
  module Version
3
- STRING = '1.1.2'
3
+ STRING = '1.2.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,131 +1,131 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: master_manipulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
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-07-14 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.6'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pry
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.9.12
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.9.12
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: 3.0.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: 3.0.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: simplecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: yard
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: markdown
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: beaker
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
117
  version: '2.7'
118
- - - ">="
118
+ - - ! '>='
119
119
  - !ruby/object:Gem::Version
120
120
  version: 2.7.0
121
121
  type: :runtime
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - "~>"
125
+ - - ~>
126
126
  - !ruby/object:Gem::Version
127
127
  version: '2.7'
128
- - - ">="
128
+ - - ! '>='
129
129
  - !ruby/object:Gem::Version
130
130
  version: 2.7.0
131
131
  description: This Gem extends the Beaker DSL for the purpose of changing things on
@@ -158,17 +158,17 @@ require_paths:
158
158
  - lib
159
159
  required_ruby_version: !ruby/object:Gem::Requirement
160
160
  requirements:
161
- - - ">="
161
+ - - ! '>='
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - ">="
166
+ - - ! '>='
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.4.8
171
+ rubygems_version: 2.4.6
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: Puppet Labs testing library for controlling a Puppet Master