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 +4 -4
- data/CHANGELOG.md +18 -2
- data/lib/train/extras/os_common.rb +4 -0
- data/lib/train/extras/os_detect_esx.rb +20 -0
- data/lib/train/transports/docker.rb +8 -0
- data/lib/train/transports/local.rb +4 -0
- data/lib/train/transports/mock.rb +4 -0
- data/lib/train/transports/ssh.rb +1 -1
- data/lib/train/transports/ssh_connection.rb +4 -0
- data/lib/train/transports/winrm_connection.rb +5 -2
- data/lib/train/version.rb +1 -1
- data/test/unit/extras/os_common_test.rb +14 -6
- data/test/unit/transports/local_test.rb +4 -0
- data/test/unit/transports/mock_test.rb +4 -0
- data/test/unit/transports/ssh_test.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2cde6d0b9f6ea8da37ae37106dc7c74c23c7c9c
|
4
|
+
data.tar.gz: db3a0053dc788fcd319813f1622b5f0846afa0d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d9d13c1fe04f144ad35c717b33eb11399cedd205fbbb0e63510d3ed474e961cc879024122b2e4b60ebcbbca883bce7febadbb97eb67acb9e22d0d2ed83d4de4
|
7
|
+
data.tar.gz: d6430db80f1620f4842afeef5dd9e1f322f5024f22c9c7dce9cbc894d2f2a8c7abd2dacb153300c93c889dc1d6a1200591660303c9c1a8ac8f60ed5270cd96db
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,23 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.
|
4
|
-
[Full Changelog](https://github.com/chef/train/compare/v0.12.
|
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
|
data/lib/train/transports/ssh.rb
CHANGED
@@ -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
|
data/lib/train/version.rb
CHANGED
@@ -259,11 +259,19 @@ describe 'os common plugin' do
|
|
259
259
|
end
|
260
260
|
|
261
261
|
describe 'with platform set to hpux' do
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
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
|
@@ -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.
|
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-
|
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.
|
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.
|