kitchen-gogetkitchen 0.1.0 → 0.1.1

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: 41da9d59651652c21009f6c33c5fbba3795b9f8d
4
- data.tar.gz: 2f11fedb110d3511d069087d997c746a20c17d47
3
+ metadata.gz: 2bb712cab9e165c8d9a9c4477350b7aec73e05d1
4
+ data.tar.gz: 790dea760d847718ddc07ac5cf581a3c845caca3
5
5
  SHA512:
6
- metadata.gz: 14b5db06c0de4249a63ef9280012fa01e4e445f0ba5677251100b89b88484cf462da726bcbe880ad0f8bbabef4cc10c61b00a2baa61ee9dafd1a17898db163a6
7
- data.tar.gz: 5942eae198a28f75c7b44562ce75dd58b7621215f6292c94e1b706d550d8fc7c77d687fc6de0296925ea6a2f0809a0101c7c221c3c05e245c05c6593988da65e
6
+ metadata.gz: 60643336e4c87552832abea846756e100ecfb7ea41d371e40dc2cd740b1dee7186877d8421e5cf32404615a3e5095c8248e3d9981fd9bf3afefc16d1b00a50bf
7
+ data.tar.gz: c38e598cc4a3407e7c79907f0e94963511bce6ab02df42a3e3d0b54e442ef00bc20b3c7cdd9829a3e653c85463ab4fbf0ae8ffaa07e9f4dfa8d484f0779fed30
data/.gitignore CHANGED
@@ -3,7 +3,7 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
6
+ Gemfile.*
7
7
  InstalledFiles
8
8
  _yardoc
9
9
  coverage
@@ -28,7 +28,7 @@ module Kitchen
28
28
  # Gogetkitchen driver for Kitchen.
29
29
  #
30
30
  # @author Don Draper <donoldfashioned@gmail.com>
31
- class GogetKitchen < Kitchen::Driver::Base
31
+ class Gogetkitchen < Kitchen::Driver::Base
32
32
  kitchen_driver_api_version 2
33
33
  plugin_version Kitchen::Driver::GOGETKITCHEN_VERSION
34
34
 
@@ -36,15 +36,40 @@ module Kitchen
36
36
  default_config :provider
37
37
  default_config :template
38
38
 
39
- binding.pry
40
-
41
39
  def create(state)
42
- binding.pry
40
+ provider = choose_provider(config[:provider])
41
+ provider.create(instance.name)
42
+ domain = Gogetit.maas.get_domain
43
+ state[:hostname] = instance.name + '.' + domain
44
+ state[:username] = config[:username]
45
+ wait_until_available(instance.name)
43
46
 
47
+ info 'Waiting for SSH..'
48
+ conn = instance.transport.connection(state)
49
+ conn.wait_until_ready
50
+ conn.close
44
51
  end
45
52
 
46
53
  def destroy(state)
47
- binding.pry
54
+ provider = choose_provider(config[:provider])
55
+ provider.destroy(instance.name)
56
+
57
+ instance.transport.connection(state).close
58
+ end
59
+
60
+ def choose_provider(provider)
61
+ case provider
62
+ when 'lxd'
63
+ Gogetit.lxd
64
+ when 'libvirt'
65
+ Gogetit.libvirt
66
+ end
67
+ end
68
+
69
+ def wait_until_available(hostname)
70
+ until Gogetit.maas.domain_name_exists?(hostname)
71
+ sleep 3
72
+ end
48
73
  end
49
74
  end
50
75
  end
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Gogetkitchen Kitchen driver
24
- GOGETKITCHEN_VERSION = "0.1.0"
24
+ GOGETKITCHEN_VERSION = "0.1.1"
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-gogetkitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Don Draper