kitchen-openstack 1.5.0 → 1.5.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: bd777017fb7da7ae301b48183ac23a1a1b2b7e48
4
- data.tar.gz: 599ddad461ccb284570401d3f5561874c15ac2be
3
+ metadata.gz: dabecabfd7d572a681fb2a9ea51dcf01c3da1113
4
+ data.tar.gz: 50c2d3cce5b1ec2ce75e15c798fc97e9dabef0d3
5
5
  SHA512:
6
- metadata.gz: f1d10cb0dc35c7c85bfa03942d0e2b0b84713e0655889c0ad41419d6cb1b84f31a104d3eb4dbfb769875bf0c601dd26828688b9f178bc390d2d836e3939bc7d7
7
- data.tar.gz: 7dba80c14cbc214df24fec6043465a1bd53f171580e5031d814b43d18c452643ac1636f61836ee724ca0aefcf3d94e6c89ddda6461307b782834f0eb066a4c16
6
+ metadata.gz: cfc8a647b20323221b6f6fb583f3d1b14a807fe8c2c0463e49b96046f97f43422f35204ba97146f5a4eacbd2935a284c9aa2b3f370c74f6c75d823f92e198478
7
+ data.tar.gz: fc1505ee21df47332240e176753c66bde27628af421c598fefdee31f0a56c6f5af1eaa381fbcde465866d243219547310e88bc6a53c0b25282ba3069e604eace
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 1.5.2 / 2014-05-31
2
+
3
+ ### Bug Fixes
4
+
5
+ * PR [#50][] - Fix possible infinite loop when generating server names
6
+ * PR [#49][] - Limit server names to 63 characters to get around OpenSSH bug
7
+ [2239](https://bugzilla.mindrot.org/show_bug.cgi?id=2239); via [@dschlenk][]
8
+
1
9
  # 1.5.0 / 2014-05-22
2
10
 
3
11
  ### New Features
@@ -93,6 +101,8 @@ certain specified NICs; via [@monsterzz][]
93
101
 
94
102
  * Initial release! Woo!
95
103
 
104
+ [#50]: https://github.com/test-kitchen/kitchen-openstack/pull/50
105
+ [#49]: https://github.com/test-kitchen/kitchen-openstack/pull/49
96
106
  [#48]: https://github.com/test-kitchen/kitchen-openstack/pull/48
97
107
  [#46]: https://github.com/test-kitchen/kitchen-openstack/pull/46
98
108
  [#41]: https://github.com/test-kitchen/kitchen-openstack/pull/41
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
+ # Encoding: UTF-8
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in kitchen-openstack.gemspec
4
6
  gemspec
5
-
6
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby
data/Rakefile CHANGED
@@ -1,12 +1,12 @@
1
- require 'bundler/gem_tasks'
1
+ # Encoding: UTF-8
2
+
3
+ require 'bundler/setup'
2
4
  require 'tailor/rake_task'
3
5
  require 'cane/rake_task'
4
6
  require 'rspec/core/rake_task'
5
7
 
6
- desc 'Run Cane to check quality metrics'
7
8
  Cane::RakeTask.new
8
9
 
9
- desc 'Run Tailor to lint check code'
10
10
  Tailor::RakeTask.new do |task|
11
11
  task.file_set '**/*.rb'
12
12
  end
@@ -17,9 +17,6 @@ task :loc do
17
17
  sh 'countloc -r lib/kitchen'
18
18
  end
19
19
 
20
- desc 'Run RSpec unit tests'
21
20
  RSpec::Core::RakeTask.new(:spec)
22
21
 
23
22
  task :default => [ :cane, :tailor, :loc, :spec ]
24
-
25
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby fdm=marker
@@ -1,4 +1,5 @@
1
- # coding: utf-8
1
+ # Encoding: UTF-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'kitchen/driver/openstack_version'
@@ -34,5 +35,3 @@ Gem::Specification.new do |spec|
34
35
  spec.add_development_dependency 'simplecov-console'
35
36
  spec.add_development_dependency 'coveralls'
36
37
  end
37
-
38
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby
@@ -1,4 +1,4 @@
1
- # -*- encoding: utf-8 -*-
1
+ # Encoding: UTF-8
2
2
  #
3
3
  # Author:: Jonathan Hartman (<j@p4nt5.com>)
4
4
  #
@@ -191,20 +191,27 @@ module Kitchen
191
191
  end
192
192
 
193
193
  def generate_name(base)
194
- # Generate what should be a unique server name
194
+ # Generate what should be a unique server name up to 63 total chars
195
+ # Base name: 15
196
+ # Username: 15
197
+ # Hostname: 23
198
+ # Random string: 7
199
+ # Separators: 3
200
+ # ================
201
+ # Total: 63
195
202
  sep = '-'
196
203
  pieces = [
197
204
  base,
198
205
  Etc.getlogin,
199
206
  Socket.gethostname,
200
- Array.new(8) { rand(36).to_s(36) }.join
207
+ Array.new(7) { rand(36).to_s(36) }.join
201
208
  ]
202
- until pieces.join(sep).length <= 64 do
203
- if pieces[2].length > 24
209
+ until pieces.join(sep).length <= 63 do
210
+ if pieces[2].length > 23
204
211
  pieces[2] = pieces[2][0..-2]
205
- elsif pieces[1].length > 16
212
+ elsif pieces[1].length > 15
206
213
  pieces[1] = pieces[1][0..-2]
207
- elsif pieces[0].length > 16
214
+ elsif pieces[0].length > 15
208
215
  pieces[0] = pieces[0][0..-2]
209
216
  end
210
217
  end
@@ -312,5 +319,3 @@ module Kitchen
312
319
  end
313
320
  end
314
321
  end
315
-
316
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby
@@ -1,4 +1,4 @@
1
- # -*- encoding: utf-8 -*-
1
+ # Encoding: UTF-8
2
2
  #
3
3
  # Author:: Jonathan Hartman (<j@p4nt5.com>)
4
4
  #
@@ -19,8 +19,6 @@
19
19
  module Kitchen
20
20
  module Driver
21
21
  # Version string for OpenStack Kitchen driver
22
- OPENSTACK_VERSION = '1.5.0'
22
+ OPENSTACK_VERSION = '1.5.2'
23
23
  end
24
24
  end
25
-
26
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby
@@ -1,4 +1,4 @@
1
- # -*- encoding: utf-8 -*-
1
+ # Encoding: UTF-8
2
2
  #
3
3
  # Author:: Jonathan Hartman (<j@p4nt5.com>)
4
4
  #
@@ -619,8 +619,22 @@ describe Kitchen::Driver::Openstack do
619
619
  Socket.stub(:gethostname).and_return('ab.c' * 20)
620
620
  end
621
621
 
622
- it 'limits the generated name to 64-characters' do
623
- expect(driver.send(:generate_name, 'long').length).to eq(64)
622
+ it 'limits the generated name to 63 characters' do
623
+ expect(driver.send(:generate_name, 'long').length).to eq(63)
624
+ end
625
+ end
626
+
627
+ context 'node with a long hostname, username, and base name' do
628
+ before(:each) do
629
+ Socket.unstub(:gethostname)
630
+ Socket.stub(:gethostname).and_return('ab.c' * 20)
631
+
632
+ Etc.unstub(:getlogin)
633
+ Etc.stub(:getlogin).and_return('user' * 20)
634
+ end
635
+
636
+ it 'limits the generated name to 63 characters' do
637
+ expect(driver.send(:generate_name, 'long' * 20).length).to eq(63)
624
638
  end
625
639
  end
626
640
  end
@@ -918,5 +932,3 @@ describe Kitchen::Driver::Openstack do
918
932
  end
919
933
  end
920
934
  end
921
-
922
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- # -*- encoding: utf-8 -*-
1
+ # Encoding: UTF-8
2
2
  #
3
3
  # Author:: Jonathan Hartman (<j@p4nt5.com>)
4
4
  #
@@ -31,5 +31,3 @@ SimpleCov.minimum_coverage 90
31
31
  SimpleCov.start
32
32
 
33
33
  require_relative '../lib/kitchen/driver/openstack'
34
-
35
- # vim: ai et ts=2 sts=2 sw=2 ft=ruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Hartman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen