train 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 27272a96b77df4648d1e5519b86108666b5c05d2
4
- data.tar.gz: 74c670d0e4b34eb6c56468055c565e0894b756ad
3
+ metadata.gz: a2cde6d0b9f6ea8da37ae37106dc7c74c23c7c9c
4
+ data.tar.gz: db3a0053dc788fcd319813f1622b5f0846afa0d2
5
5
  SHA512:
6
- metadata.gz: 0b5c0ee5b61cbb5e7095a41d16e58f746873c09f03a771d9507e16258806c03c9ae61ba0fe3894e1a82cd9145a3056c7db07c4af813a089a72e3ea33a5e6b272
7
- data.tar.gz: 93a304ceede19c18bb8cb8c7becfd06a02f9b6b1ea79f07200c2b24fa4dafcdee58e71de4be69c4ec7415b33e781f3b5886f376b85dfd8f128e090a845dd5b74
6
+ metadata.gz: 5d9d13c1fe04f144ad35c717b33eb11399cedd205fbbb0e63510d3ed474e961cc879024122b2e4b60ebcbbca883bce7febadbb97eb67acb9e22d0d2ed83d4de4
7
+ data.tar.gz: d6430db80f1620f4842afeef5dd9e1f322f5024f22c9c7dce9cbc894d2f2a8c7abd2dacb153300c93c889dc1d6a1200591660303c9c1a8ac8f60ed5270cd96db
@@ -1,7 +1,23 @@
1
1
  # Change Log
2
2
 
3
- ## [0.12.1](https://github.com/chef/train/tree/0.12.1) (2016-05-23)
4
- [Full Changelog](https://github.com/chef/train/compare/v0.12.0...0.12.1)
3
+ ## [0.13.0](https://github.com/chef/train/tree/0.13.0) (2016-06-16)
4
+ [Full Changelog](https://github.com/chef/train/compare/v0.12.1...0.13.0)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - provide uri-formatted information on all connections [\#113](https://github.com/chef/train/pull/113) ([arlimus](https://github.com/arlimus))
9
+
10
+ **Fixed bugs:**
11
+
12
+ - Authentication with SSH Server on OSX is failing [\#111](https://github.com/chef/train/issues/111)
13
+
14
+ **Merged pull requests:**
15
+
16
+ - adding support for vmware's esx server [\#114](https://github.com/chef/train/pull/114) ([Anirudh-Gupta](https://github.com/Anirudh-Gupta))
17
+ - add missing keyboard-interactive authentication method [\#112](https://github.com/chef/train/pull/112) ([chris-rock](https://github.com/chris-rock))
18
+
19
+ ## [v0.12.1](https://github.com/chef/train/tree/v0.12.1) (2016-05-23)
20
+ [Full Changelog](https://github.com/chef/train/compare/v0.12.0...v0.12.1)
5
21
 
6
22
  **Fixed bugs:**
7
23
 
@@ -59,6 +59,9 @@ module Train::Extras
59
59
  'hpux' => %w{
60
60
  hpux
61
61
  },
62
+ 'esx' => %w{
63
+ esx
64
+ },
62
65
  }
63
66
 
64
67
  OS['linux'] = %w{linux alpine arch coreos exherbo gentoo slackware} + OS['redhat'] + OS['debian'] + OS['suse']
@@ -109,6 +112,7 @@ module Train::Extras
109
112
 
110
113
  return detect_windows if pf == 'windows'
111
114
  return detect_darwin if pf == 'darwin'
115
+ return detect_esx if pf == 'esx'
112
116
 
113
117
  if %w{freebsd netbsd openbsd aix solaris2 hpux}.include?(pf)
114
118
  return detect_via_uname
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ # author: Dominik Richter
3
+ # author: Christoph Hartmann
4
+ #
5
+ # This is heavily based on:
6
+ #
7
+ # OHAI https://github.com/chef/ohai
8
+ # by Adam Jacob, Chef Software Inc
9
+ #
10
+
11
+ module Train::Extras
12
+ module DetectEsx
13
+ def detect_esx
14
+ @platform[:family] = 'esx'
15
+ @platform[:name] = uname_s.lines[0].chomp
16
+ @platform[:release] = uname_r.lines[0].chomp
17
+ true
18
+ end
19
+ end
20
+ end
@@ -92,6 +92,14 @@ class Train::Transports::Docker
92
92
  raise
93
93
  end
94
94
 
95
+ def uri
96
+ if @container.nil?
97
+ "docker://#{@id}"
98
+ else
99
+ "docker://#{@container.id}"
100
+ end
101
+ end
102
+
95
103
  class OS < OSCommon
96
104
  def initialize(backend)
97
105
  # hardcoded to unix/linux for now, until other operating systems
@@ -47,6 +47,10 @@ module Train::Transports
47
47
  def login_command
48
48
  nil # none, open your shell
49
49
  end
50
+
51
+ def uri
52
+ 'local://'
53
+ end
50
54
  end
51
55
  end
52
56
  end
@@ -70,6 +70,10 @@ class Train::Transports::Mock
70
70
  @commands = {}
71
71
  end
72
72
 
73
+ def uri
74
+ 'mock://'
75
+ end
76
+
73
77
  def mock_os(value)
74
78
  @os = OS.new(self, value)
75
79
  end
@@ -95,7 +95,7 @@ module Train::Transports
95
95
  end
96
96
 
97
97
  unless options[:password].nil?
98
- options[:auth_methods].push('password')
98
+ options[:auth_methods].push('password', 'keyboard-interactive')
99
99
  end
100
100
 
101
101
  super
@@ -151,6 +151,10 @@ class Train::Transports::SSH
151
151
  execute(PING_COMMAND.dup)
152
152
  end
153
153
 
154
+ def uri
155
+ "ssh://#{@username}@#{@hostname}:#{@port}"
156
+ end
157
+
154
158
  private
155
159
 
156
160
  PING_COMMAND = "echo '[SSH] Established'".freeze
@@ -27,7 +27,7 @@ class Train::Transports::WinRM
27
27
  # host such as executing commands, transferring files, etc.
28
28
  #
29
29
  # @author Fletcher Nichol <fnichol@nichol.ca>
30
- class Connection < BaseConnection
30
+ class Connection < BaseConnection # rubocop:disable Metrics/ClassLength
31
31
  def initialize(options)
32
32
  super(options)
33
33
  @endpoint = @options.delete(:endpoint)
@@ -42,7 +42,6 @@ class Train::Transports::WinRM
42
42
  # (see Base::Connection#close)
43
43
  def close
44
44
  return if @session.nil?
45
-
46
45
  session.close
47
46
  ensure
48
47
  @session = nil
@@ -99,6 +98,10 @@ class Train::Transports::WinRM
99
98
  execute(PING_COMMAND.dup)
100
99
  end
101
100
 
101
+ def uri
102
+ "winrm://#{options[:user]}@#{@endpoint}:#{@rdp_port}"
103
+ end
104
+
102
105
  private
103
106
 
104
107
  PING_COMMAND = "Write-Host '[WinRM] Established\n'".freeze
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '0.12.1'.freeze
6
+ VERSION = '0.13.0'.freeze
7
7
  end
@@ -259,11 +259,19 @@ describe 'os common plugin' do
259
259
  end
260
260
 
261
261
  describe 'with platform set to hpux' do
262
- let(:os) { mock_platform('hpux') }
263
- it { os.solaris?.must_equal(false) }
264
- it { os.linux?.must_equal(false) }
265
- it { os.unix?.must_equal(true) }
266
- it { os.hpux?.must_equal(true) }
267
- end
262
+ let(:os) { mock_platform('hpux') }
263
+ it { os.solaris?.must_equal(false) }
264
+ it { os.linux?.must_equal(false) }
265
+ it { os.unix?.must_equal(true) }
266
+ it { os.hpux?.must_equal(true) }
267
+ end
268
+
269
+ describe 'with platform set to esx' do
270
+ let(:os) { mock_platform('esx') }
271
+ it { os.solaris?.must_equal(false) }
272
+ it { os.linux?.must_equal(false) }
273
+ it { os.unix?.must_equal(false) }
274
+ it { os.esx?.must_equal(true) }
275
+ end
268
276
 
269
277
  end
@@ -32,6 +32,10 @@ describe 'local transport' do
32
32
  connection.must_be_kind_of Train::Transports::Local::Connection
33
33
  end
34
34
 
35
+ it 'provides a uri' do
36
+ connection.uri.must_equal "local://"
37
+ end
38
+
35
39
  it 'doesnt wait to be read' do
36
40
  connection.wait_until_ready.must_be_nil
37
41
  end
@@ -15,6 +15,10 @@ describe 'mock transport' do
15
15
  connection.wont_be_nil
16
16
  end
17
17
 
18
+ it 'provides a uri' do
19
+ connection.uri.must_equal 'mock://'
20
+ end
21
+
18
22
  describe 'when running a mocked command' do
19
23
  let(:mock_cmd) { }
20
24
 
@@ -52,6 +52,10 @@ describe 'ssh transport' do
52
52
  connection.must_be_kind_of Train::Transports::SSH::Connection
53
53
  end
54
54
 
55
+ it 'provides a uri' do
56
+ connection.uri.must_equal "ssh://root@#{conf[:host]}:22"
57
+ end
58
+
55
59
  it 'must respond to wait_until_ready' do
56
60
  connection.must_respond_to :wait_until_ready
57
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -153,6 +153,7 @@ files:
153
153
  - lib/train/extras/linux_lsb.rb
154
154
  - lib/train/extras/os_common.rb
155
155
  - lib/train/extras/os_detect_darwin.rb
156
+ - lib/train/extras/os_detect_esx.rb
156
157
  - lib/train/extras/os_detect_linux.rb
157
158
  - lib/train/extras/os_detect_unix.rb
158
159
  - lib/train/extras/os_detect_windows.rb
@@ -240,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
241
  version: '0'
241
242
  requirements: []
242
243
  rubyforge_project:
243
- rubygems_version: 2.4.6
244
+ rubygems_version: 2.5.1
244
245
  signing_key:
245
246
  specification_version: 4
246
247
  summary: Transport interface to talk to different backends.