kitchen-digitalocean 0.6.4 → 0.7.0

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: a805eadfb3a4bafb3c4bd6b6060d170fc191d507
4
- data.tar.gz: c71f2be954f085143a6b0963e851936184f2907a
3
+ metadata.gz: 2962e0d424072f44969958a36b4b5dd1a447b087
4
+ data.tar.gz: 83119613368027f4c88802cf2496d4f76be47a87
5
5
  SHA512:
6
- metadata.gz: e28f7444111dfdda0ff0e43714cd242736b8ec7bda1196d383bc3a92487344ca09c09ef72ab99228def885e40d8f3a368bc28de1acc2f76757ab4ee0d2264ac1
7
- data.tar.gz: 3402d1c69e89a43c77006c718fe17ddea073d5e4119f8f1e487c7924443726ddb2de52236387d6ded3ee16caf81ee0158ea09a2934a424b425d9d49ec9e9cbbc
6
+ metadata.gz: ad93eeb4021fe0a181e5667fbb25932f35e5447a7212cf51c0c5804ef54bf0b7fb22fd339151d83c785607e759449089b017d4e10774711a2227249cc9ba4d51
7
+ data.tar.gz: 7673f18201fe215ed05d4df71d9ad3e55585e6c7f9558ef1630900a86b9d19a7252e6229c15c17023f5199887574253d33bd22579415cc2f8e48ec42c717843b
data/.travis.yml CHANGED
@@ -1,10 +1,11 @@
1
+ ---
1
2
  language: ruby
2
-
3
- gemfile:
4
- - Gemfile
5
-
6
3
  rvm:
7
4
  - 1.9.3
8
- - 2.0.0
5
+ - 2.0
6
+ - 2.1
7
+ bundler_args: --jobs 7
8
+ gemfile:
9
+ - Gemfile
9
10
 
10
11
  # vim: ai et ts=2 sts=2 sw=2 ft=yaml
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
- # 0.6.3 / 2014-04-28
1
+ # 0.7.0 / 2014-05-20
2
+
3
+ * [@zhann](https://github.com/Zhann) [PR #15] Makes hostnames RFC compatible
4
+ * [@coderanger](https://github.com/coderanger) [PR #14] New image ID for centos-6.5
5
+ * [@coderanger](https://github.com/coderanger) [PR #13] Allow using a correctly name-scoped environment variable for ssh_key_ids
6
+
7
+ # 0.6.4 / 2014-05-02
2
8
 
3
9
  * Update image list.
4
10
 
data/README.md CHANGED
@@ -43,7 +43,7 @@ You also have the option of providing your credentials from environment variable
43
43
  ```bash
44
44
  export DIGITALOCEAN_CLIENT_ID="1234"
45
45
  export DIGITALOCEAN_API_KEY="5678"
46
- export SSH_KEY_IDS="1234, 5678"
46
+ export DIGITALOCEAN_SSH_KEY_IDS="1234, 5678"
47
47
  ```
48
48
 
49
49
  Note that your `SSH_KEY_ID` must be the numeric id of your ssh key, not the symbolic name. To get the numeric ID
data/Rakefile CHANGED
@@ -22,6 +22,6 @@ end
22
22
  desc 'Run RSpec unit tests'
23
23
  RSpec::Core::RakeTask.new(:spec)
24
24
 
25
- task :default => [ :cane, :rubocop, :loc, :spec ]
25
+ task default: [:cane, :rubocop, :loc, :spec]
26
26
 
27
27
  # vim: ai et ts=2 sts=2 sw=2 ft=ruby fdm=marker
@@ -6,7 +6,7 @@
6
6
  "ubuntu-13.10": "3101918",
7
7
  "ubuntu-14.04": "3240036",
8
8
  "centos-5.8": "1601",
9
- "centos-6.5": "3240850",
9
+ "centos-6.5": "3448674",
10
10
  "centos-6.4": "562354",
11
11
  "debian-6.0": "12573",
12
12
  "debian-7.0": "3445812",
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = 'https://github.com/test-kitchen/kitchen-digitalocean'
14
14
  spec.license = 'Apache 2.0'
15
15
 
16
- spec.files = `git ls-files`.split($/)
16
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
@@ -60,7 +60,7 @@ module Kitchen
60
60
  end
61
61
 
62
62
  default_config :ssh_key_ids do |driver|
63
- ENV['SSH_KEY_IDS']
63
+ ENV['DIGITALOCEAN_SSH_KEY_IDS'] || ENV['SSH_KEY_IDS']
64
64
  end
65
65
 
66
66
  required_config :digitalocean_client_id
@@ -110,7 +110,10 @@ module Kitchen
110
110
  def default_name
111
111
  # Generate what should be a unique server name
112
112
  rand_str = Array.new(8) { rand(36).to_s(36) }.join
113
- "#{instance.name}-#{Etc.getlogin}-#{Socket.gethostname}-#{rand_str}"
113
+ "#{instance.name}-"\
114
+ "#{Etc.getlogin.gsub('_', '-')}-"\
115
+ "#{rand_str}-"\
116
+ "#{Socket.gethostname}"
114
117
  end
115
118
 
116
119
  private
@@ -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.6.4'
22
+ DIGITALOCEAN_VERSION = '0.7.0'
23
23
  end
24
24
  end
25
25
 
@@ -32,10 +32,10 @@ describe Kitchen::Driver::Digitalocean do
32
32
 
33
33
  let(:instance) do
34
34
  double(
35
- :name => 'potatoes',
36
- :logger => logger,
37
- :to_str => 'instance',
38
- :platform => double(:name => platform_name)
35
+ name: 'potatoes',
36
+ logger: logger,
37
+ to_str: 'instance',
38
+ platform: double(name: platform_name)
39
39
  )
40
40
  end
41
41
 
@@ -101,14 +101,14 @@ describe Kitchen::Driver::Digitalocean do
101
101
 
102
102
  context 'overridden options' do
103
103
  config = {
104
- :image_id => '22',
105
- :flavor_id => '63',
106
- :ssh_key_ids => '5678',
107
- :username => 'admin',
108
- :port => '2222',
109
- :server_name => 'puppy',
110
- :region_id => '1',
111
- :flavor => '1GB'
104
+ image_id: '22',
105
+ flavor_id: '63',
106
+ ssh_key_ids: '5678',
107
+ username: 'admin',
108
+ port: '2222',
109
+ server_name: 'puppy',
110
+ region_id: '1',
111
+ flavor: '1GB'
112
112
  }
113
113
 
114
114
  let(:config) { config }
@@ -123,8 +123,8 @@ describe Kitchen::Driver::Digitalocean do
123
123
 
124
124
  describe '#create' do
125
125
  let(:server) do
126
- double(:id => 'test123', :wait_for => true,
127
- :public_ip_address => '1.2.3.4')
126
+ double(id: 'test123', wait_for: true,
127
+ public_ip_address: '1.2.3.4')
128
128
  end
129
129
  let(:driver) do
130
130
  d = Kitchen::Driver::Digitalocean.new(config)
@@ -138,8 +138,8 @@ describe Kitchen::Driver::Digitalocean do
138
138
  context 'username and API key only provided' do
139
139
  let(:config) do
140
140
  {
141
- :digitalocean_client_id => 'hello',
142
- :digitalocean_api_key => 'world'
141
+ digitalocean_client_id: 'hello',
142
+ digitalocean_api_key: 'world'
143
143
  }
144
144
  end
145
145
 
@@ -163,10 +163,10 @@ describe Kitchen::Driver::Digitalocean do
163
163
  describe '#destroy' do
164
164
  let(:server_id) { '12345' }
165
165
  let(:hostname) { 'example.com' }
166
- let(:state) { { :server_id => server_id, :hostname => hostname } }
166
+ let(:state) { { server_id: server_id, hostname: hostname } }
167
167
  let(:server) { double(:nil? => false, :destroy => true) }
168
- let(:servers) { double(:get => server) }
169
- let(:compute) { double(:servers => servers) }
168
+ let(:servers) { double(get: server) }
169
+ let(:compute) { double(servers: servers) }
170
170
 
171
171
  let(:driver) do
172
172
  d = Kitchen::Driver::Digitalocean.new(config)
@@ -200,7 +200,7 @@ describe Kitchen::Driver::Digitalocean do
200
200
  s.stub(:get).with('12345').and_return(nil)
201
201
  s
202
202
  end
203
- let(:compute) { double(:servers => servers) }
203
+ let(:compute) { double(servers: servers) }
204
204
  let(:driver) do
205
205
  d = Kitchen::Driver::Digitalocean.new(config)
206
206
  d.instance = instance
@@ -218,8 +218,8 @@ describe Kitchen::Driver::Digitalocean do
218
218
  describe '#compute' do
219
219
  let(:config) do
220
220
  {
221
- :digitalocean_client_id => 'monkey',
222
- :digitalocean_api_key => 'potato',
221
+ digitalocean_client_id: 'monkey',
222
+ digitalocean_api_key: 'potato',
223
223
  }
224
224
  end
225
225
 
@@ -232,7 +232,7 @@ describe Kitchen::Driver::Digitalocean do
232
232
 
233
233
  context 'no username provided' do
234
234
  let(:config) do
235
- { :digitalocean_client_id => nil, :digitalocean_api_key => '1234' }
235
+ { digitalocean_client_id: nil, digitalocean_api_key: '1234' }
236
236
  end
237
237
 
238
238
  it 'raises an error' do
@@ -242,7 +242,7 @@ describe Kitchen::Driver::Digitalocean do
242
242
 
243
243
  context 'no API key provided' do
244
244
  let(:config) do
245
- { :digitalocean_client_id => 'monkey', :digitalocean_api_key => nil }
245
+ { digitalocean_client_id: 'monkey', digitalocean_api_key: nil }
246
246
  end
247
247
 
248
248
  it 'raises an error' do
@@ -254,16 +254,16 @@ describe Kitchen::Driver::Digitalocean do
254
254
  describe '#create_server' do
255
255
  let(:config) do
256
256
  {
257
- :server_name => 'hello',
258
- :image_id => 'there',
259
- :flavor_id => '68',
260
- :region_id => '3',
261
- :private_networking => true,
262
- :ssh_key_ids => '1234'
257
+ server_name: 'hello',
258
+ image_id: 'there',
259
+ flavor_id: '68',
260
+ region_id: '3',
261
+ private_networking: true,
262
+ ssh_key_ids: '1234'
263
263
  }
264
264
  end
265
265
  before(:each) do
266
- @expected = config.merge(:name => config[:server_name])
266
+ @expected = config.merge(name: config[:server_name])
267
267
  @expected.delete_if do |k, v|
268
268
  k == :server_name
269
269
  end
@@ -273,7 +273,7 @@ describe Kitchen::Driver::Digitalocean do
273
273
  s.stub(:create) { |arg| arg }
274
274
  s
275
275
  end
276
- let(:compute) { double(:servers => servers) }
276
+ let(:compute) { double(servers: servers) }
277
277
  let(:driver) do
278
278
  d = Kitchen::Driver::Digitalocean.new(config)
279
279
  d.instance = instance
@@ -289,11 +289,11 @@ describe Kitchen::Driver::Digitalocean do
289
289
  describe 'Region and Flavor names should be converted to IDs' do
290
290
  let(:config) do
291
291
  {
292
- :server_name => 'hello',
293
- :image_id => 'there',
294
- :flavor => '2gb',
295
- :region => 'amsterdam 2',
296
- :ssh_key_ids => '1234'
292
+ server_name: 'hello',
293
+ image_id: 'there',
294
+ flavor: '2gb',
295
+ region: 'amsterdam 2',
296
+ ssh_key_ids: '1234'
297
297
  }
298
298
  end
299
299
 
@@ -314,7 +314,7 @@ describe Kitchen::Driver::Digitalocean do
314
314
 
315
315
  it 'generates a name' do
316
316
  expect(driver.default_name).to match(
317
- /^potatoes-user-host-/)
317
+ /^potatoes-user-(\S*)-host/)
318
318
  end
319
319
  end
320
320
  end
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.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Fitzgerald
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2014-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen