kitchen-dokken 0.0.16 → 0.0.17

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: eb02a9c1e743b3b22ae51e98b789be9315824251
4
- data.tar.gz: 3e8d2a2232182a02512524a45a2d32b1b64fcdc3
3
+ metadata.gz: 41ca8d4ef2829b2ad1047011468fb72489f2abad
4
+ data.tar.gz: e7c61db95324279df10e5bce107022277615bdcc
5
5
  SHA512:
6
- metadata.gz: bab9033b4dd0301ea3fd0082bfb4a58a9f60f59d6b791909c454b79f2b0dc560fa25ae15ad4d14fe3ba955ff188bf5fd2666819bb5e91ed50e112d2662761411
7
- data.tar.gz: cc62afabc21be68ea48890031a038d4428c988189474a4725270b927346117c9ab6b203dd69ab8329cfbf69faeb82396d8b6149468f669ca3195802468387953
6
+ metadata.gz: d843971c8690453768bc672dfd317a601ada976cf2c7f8c423926f3d1c72f7ae3e35a998697d6298e42669637883138f21f83dc2a51d243ad3468e77bf2e8a4d
7
+ data.tar.gz: e928ecd38a6c8cdd85ada3eb2009321a604a9a188eb44d41bf7a668684613f904e35ec4c46e31b60e49556d103f41b02bc433845c83e6b123a84e88de4eaf0bb
@@ -239,18 +239,6 @@ module Kitchen
239
239
  puts "Image #{name} not found. Nothing to delete."
240
240
  end
241
241
 
242
- def delete_container(name)
243
- with_retries { @container = Docker::Container.get(name, docker_connection) }
244
- puts "Destroying container #{name}."
245
- with_retries do
246
- @container.stop(force: true)
247
- wait_running_state(args['name'], false)
248
- end
249
- with_retries { @container.delete(force: true, v: true) }
250
- rescue
251
- puts "Container #{name} not found. Nothing to delete."
252
- end
253
-
254
242
  def container_exist?(name)
255
243
  return true if Docker::Container.get(name)
256
244
  rescue
@@ -284,15 +272,33 @@ module Kitchen
284
272
  @container ? @container.info['State'] : {}
285
273
  end
286
274
 
275
+ def delete_container(name)
276
+ with_retries { @container = Docker::Container.get(name, docker_connection) }
277
+ puts "Destroying container #{name}."
278
+
279
+ begin
280
+ with_retries { @container.delete(force: true, v: true) }
281
+ rescue
282
+ puts "Container #{name} not found. Nothing to stop."
283
+ end
284
+
285
+ begin
286
+ with_retries do
287
+ @container.stop(force: true)
288
+ wait_running_state(args['name'], false)
289
+ end
290
+ rescue
291
+ puts "Container #{name} not found. Nothing to delete."
292
+ end
293
+ end
294
+
287
295
  def wait_running_state(name, v)
288
296
  @container = Docker::Container.get(name)
289
- # require 'pry' ; binding.pry
290
297
  i = 0
291
298
  tries = 20
292
299
  until container_state['Running'] == v || container_state['FinishedAt'] != '0001-01-01T00:00:00Z'
293
300
  i += 1
294
301
  break if i == tries
295
- puts "SEANDEBUG: #{container_state['Running']}"
296
302
  sleep 0.1
297
303
  @container = Docker::Container.get(name)
298
304
  end
@@ -19,6 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Dokken Kitchen driver
22
- DOKKEN_VERSION = '0.0.16'
22
+ DOKKEN_VERSION = '0.0.17'
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-dokken
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean OMeara