kitchen-digitalocean 0.9.1 → 0.9.2

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: 2fe7bdd3909e3ae69b7ba50a20c5e5b2ca191e41
4
- data.tar.gz: 5f831d21a8ad796d97bf15893d819ac8701a5d49
3
+ metadata.gz: 7b195be813c0b4455e274641c9bafe0c525ac78b
4
+ data.tar.gz: 2cf560048e69eea4f874d83712bd5bcfefa33eea
5
5
  SHA512:
6
- metadata.gz: 0dd3a4eba799d56a8c108d4ce00d059c7d3b348be9b4fc4ae58e7cd489eb4d52dfd211752405ba58318234d3f2be48631dec4b6618bfc92c638854e6e286cb0b
7
- data.tar.gz: 42500ab5e6e2d158ccd477b1f2551198fc817367e1e044908e567d13bf8890759c79e471c94af0829ac21e0126279191b9830d39cd2dcbdb7a2e96d279b5f6ac
6
+ metadata.gz: 57fc52d14b37f39efddf86cccfb6f0abfcfea06cd4baa14f9ddf18714f9e7c832e948021e2113c5efd558dd449f8508f61de9733aff2e37de7caa270153cbada
7
+ data.tar.gz: e12307e0a2bfa4af8008ba062179b252ef9165c9a7c0eb00a7e36e992c492dcd217049c7c71399a647ca10fa54c3299dfdbd78e7ac69c3069eddb50924e0fd8b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.9.2 / 2015-07-20
2
+
3
+ * [@joonas](https://github.com/joonas) [PR #41] Add the ability to map well-known platforms to slugs
4
+
1
5
  # 0.9.1 / 2015-06-19
2
6
 
3
7
  * [@olivielpeau](https://github.com/olivielpeau) [PR #40] Destroy properly droplets that are still "new"
@@ -95,8 +95,12 @@ module Kitchen
95
95
  state.delete(:hostname)
96
96
  end
97
97
 
98
+ # This method attempts to fetch the platform from a list of well-known
99
+ # platform => slug mappings, and falls back to using just the platform as
100
+ # provided if it can't find a mapping.
98
101
  def default_image
99
- instance.platform.name
102
+ platform_to_slug_mapping.fetch(instance.platform.name,
103
+ instance.platform.name)
100
104
  end
101
105
 
102
106
  # Generate what should be a unique server name up to 63 total chars
@@ -161,6 +165,24 @@ module Kitchen
161
165
  def debug_client_config
162
166
  debug("digitalocean_api_key #{config[:digitalocean_access_token]}")
163
167
  end
168
+
169
+ def platform_to_slug_mapping
170
+ {
171
+ 'centos-5.10' => 'centos-5-8-x64',
172
+ 'centos-6.5' => 'centos-6-5-x64',
173
+ 'centos-7.0' => 'centos-7-0-x64',
174
+ 'debian-6.0' => 'debian-6-0-x64',
175
+ 'debian-7.0' => 'debian-7-0-x64',
176
+ 'debian-8.1' => 'debian-8-x64',
177
+ 'fedora-21' => 'fedora-21-x64',
178
+ 'fedora-22' => 'fedora-22-x64',
179
+ 'freebsd-10.1' => 'freebsd-10-1-x64',
180
+ 'ubuntu-12.04' => 'ubuntu-12-04-x64',
181
+ 'ubuntu-14.04' => 'ubuntu-14-04-x64',
182
+ 'ubuntu-14.10' => 'ubuntu-14-10-x64',
183
+ 'ubuntu-15.04' => 'ubuntu-15-04-x64'
184
+ }
185
+ end
164
186
  end
165
187
  end
166
188
  end
@@ -19,7 +19,7 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for Digital Ocean Kitchen driver
22
- DIGITALOCEAN_VERSION = '0.9.1'
22
+ DIGITALOCEAN_VERSION = '0.9.2'
23
23
  end
24
24
  end
25
25
 
@@ -85,6 +85,14 @@ describe Kitchen::Driver::Digitalocean do
85
85
  end
86
86
  end
87
87
 
88
+ context 'platform name matches a known platform => slug mapping' do
89
+ let(:platform_name) { 'ubuntu-14.04' }
90
+
91
+ it 'matches the correct image slug' do
92
+ expect(driver[:image]).to eq('ubuntu-14-04-x64')
93
+ end
94
+ end
95
+
88
96
  context 'overridden options' do
89
97
  config = {
90
98
  image: 'debian-7-0-x64',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Fitzgerald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen