train 1.5.6 → 1.5.11
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 +17 -8
- data/lib/train/file/remote/unix.rb +2 -1
- data/lib/train/platforms/detect/helpers/os_linux.rb +2 -2
- data/lib/train/platforms/detect/specifications/os.rb +8 -2
- data/lib/train/plugins/base_connection.rb +0 -5
- data/lib/train/transports/cisco_ios_connection.rb +0 -2
- data/lib/train/transports/gcp.rb +2 -0
- data/lib/train/transports/local.rb +0 -4
- data/lib/train/transports/ssh.rb +1 -0
- data/lib/train/transports/vmware.rb +0 -4
- data/lib/train/version.rb +1 -1
- data/test/fixtures/plugins/train-test-fixture/lib/train-test-fixture/connection.rb +0 -4
- data/test/unit/platforms/detect/os_linux_test.rb +8 -0
- data/test/unit/transports/gcp_test.rb +60 -0
- data/test/unit/transports/vmware_test.rb +0 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4053a5448990953c02982f884a3af8d00166920843713ffea3e126848db9f04e
|
4
|
+
data.tar.gz: 468e054659adf76575bc32bb56b3b31e615ba3eae84601573689bcfd1881abd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c6921286cd8ae8779452e28cc9f0d0ad2e97223e2b39cad4593a2774e92c2580eae78f24f664136948c9746e76076a72f51ed55e11fdeacbc569f8c49335ca2
|
7
|
+
data.tar.gz: '06485051796b00ec02e7325f211f61de842008e386a8b855eef52166fe7160975a9745a68305dd669aa8341bcfdafafbae2e3cb6a47ca6803371621cfc5554d5'
|
data/CHANGELOG.md
CHANGED
@@ -1,19 +1,29 @@
|
|
1
|
-
<!-- latest_release 1.5.
|
2
|
-
## [v1.5.
|
1
|
+
<!-- latest_release 1.5.11 -->
|
2
|
+
## [v1.5.11](https://github.com/inspec/train/tree/v1.5.11) (2018-12-10)
|
3
3
|
|
4
4
|
#### Merged Pull Requests
|
5
|
-
-
|
5
|
+
- Pass logger to Cisco IOS transport [#381](https://github.com/inspec/train/pull/381) ([btm](https://github.com/btm))
|
6
6
|
<!-- latest_release -->
|
7
7
|
|
8
|
-
<!-- release_rollup since=1.5.
|
9
|
-
### Changes since 1.5.
|
8
|
+
<!-- release_rollup since=1.5.6 -->
|
9
|
+
### Changes since 1.5.6 release
|
10
10
|
|
11
11
|
#### Merged Pull Requests
|
12
|
-
-
|
13
|
-
-
|
12
|
+
- Pass logger to Cisco IOS transport [#381](https://github.com/inspec/train/pull/381) ([btm](https://github.com/btm)) <!-- 1.5.11 -->
|
13
|
+
- Added a new matcher for amazon linux 2 [#380](https://github.com/inspec/train/pull/380) ([artyomtkachenko](https://github.com/artyomtkachenko)) <!-- 1.5.10 -->
|
14
|
+
- Remove `#local?` [#365](https://github.com/inspec/train/pull/365) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 1.5.9 -->
|
15
|
+
- Fix shallow_link_path on remote unix [#373](https://github.com/inspec/train/pull/373) ([mheiges](https://github.com/mheiges)) <!-- 1.5.8 -->
|
16
|
+
- Add Google API application info [#378](https://github.com/inspec/train/pull/378) ([nathenharvey](https://github.com/nathenharvey)) <!-- 1.5.7 -->
|
14
17
|
<!-- release_rollup -->
|
15
18
|
|
16
19
|
<!-- latest_stable_release -->
|
20
|
+
## [v1.5.6](https://github.com/inspec/train/tree/v1.5.6) (2018-11-01)
|
21
|
+
|
22
|
+
#### Merged Pull Requests
|
23
|
+
- Fix Cisco IOS detection when banners lack a `\r\n` [#372](https://github.com/inspec/train/pull/372) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
24
|
+
- Adds cached_client method in BaseConnection [#371](https://github.com/inspec/train/pull/371) ([dmccown](https://github.com/dmccown))
|
25
|
+
<!-- latest_stable_release -->
|
26
|
+
|
17
27
|
## [v1.5.4](https://github.com/inspec/train/tree/v1.5.4) (2018-10-18)
|
18
28
|
|
19
29
|
#### Merged Pull Requests
|
@@ -21,7 +31,6 @@
|
|
21
31
|
- Remove the legacy version bumping from the rakefile [#359](https://github.com/inspec/train/pull/359) ([tas50](https://github.com/tas50))
|
22
32
|
- Adds Azure Vault Client [#351](https://github.com/inspec/train/pull/351) ([r-fennell](https://github.com/r-fennell))
|
23
33
|
- Correct example plugin link [#363](https://github.com/inspec/train/pull/363) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
24
|
-
<!-- latest_stable_release -->
|
25
34
|
|
26
35
|
## [v1.5.0](https://github.com/inspec/train/tree/v1.5.0) (2018-09-27)
|
27
36
|
|
@@ -10,8 +10,8 @@ module Train::Platforms::Detect::Helpers
|
|
10
10
|
case conf
|
11
11
|
when /rawhide/i
|
12
12
|
/((\d+) \(Rawhide\))/i.match(conf)[1].downcase
|
13
|
-
when /Amazon Linux
|
14
|
-
/
|
13
|
+
when /Amazon Linux/i
|
14
|
+
/([\d\.]+)/.match(conf)[1]
|
15
15
|
when /derived from .*linux|amazon/i
|
16
16
|
/Linux ((\d+|\.)+)/i.match(conf)[1]
|
17
17
|
else
|
@@ -17,9 +17,15 @@ module Train::Platforms::Detect::Specifications
|
|
17
17
|
|
18
18
|
plat.family('windows').in_family('os')
|
19
19
|
.detect {
|
20
|
-
|
21
|
-
|
20
|
+
# Can't return from a `proc` thus the `is_windows` shenanigans
|
21
|
+
is_windows = false
|
22
|
+
is_windows = true if winrm?
|
23
|
+
|
24
|
+
if @backend.class.to_s == 'Train::Transports::Local::Connection'
|
25
|
+
is_windows = true if ruby_host_os(/mswin|mingw32|windows/)
|
22
26
|
end
|
27
|
+
|
28
|
+
is_windows
|
23
29
|
}
|
24
30
|
# windows platform
|
25
31
|
plat.name('windows').in_family('windows')
|
data/lib/train/transports/gcp.rb
CHANGED
@@ -88,6 +88,8 @@ module Train::Transports
|
|
88
88
|
scopes = ['https://www.googleapis.com/auth/cloud-platform',
|
89
89
|
'https://www.googleapis.com/auth/compute']
|
90
90
|
authorization = Google::Auth.get_application_default(scopes)
|
91
|
+
Google::Apis::ClientOptions.default.application_name = 'chef-inspec-train'
|
92
|
+
Google::Apis::ClientOptions.default.application_version = Train::VERSION
|
91
93
|
Google::Apis::RequestOptions.default.authorization = authorization
|
92
94
|
end
|
93
95
|
|
data/lib/train/transports/ssh.rb
CHANGED
@@ -218,6 +218,7 @@ module Train::Transports
|
|
218
218
|
# We will also support the sudo password field for the same purpose
|
219
219
|
# for the interim. # TODO
|
220
220
|
ios_options[:enable_password] = @options[:enable_password] || @options[:sudo_password]
|
221
|
+
ios_options[:logger] = @options[:logger]
|
221
222
|
ios_options.merge!(@connection_options)
|
222
223
|
conn = CiscoIOSConnection.new(ios_options)
|
223
224
|
end
|
data/lib/train/version.rb
CHANGED
@@ -28,6 +28,14 @@ describe 'os_linux' do
|
|
28
28
|
it 'normal linux' do
|
29
29
|
detector.redhatish_version('derived from Ubuntu Linux 11').must_equal('11')
|
30
30
|
end
|
31
|
+
|
32
|
+
it 'amazon linux 2 new release naming schema' do
|
33
|
+
detector.redhatish_version('Amazon Linux release 2 (Karoo)').must_equal('2')
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'amazon linux 2 old release naming schema' do
|
37
|
+
detector.redhatish_version('Amazon Linux 2').must_equal('2')
|
38
|
+
end
|
31
39
|
end
|
32
40
|
|
33
41
|
describe 'lsb parse' do
|
@@ -99,6 +99,18 @@ describe 'gcp transport' do
|
|
99
99
|
client.is_a?(Google::Apis::ComputeV1::ComputeService).must_equal true
|
100
100
|
cache[:api_call].count.must_equal 0
|
101
101
|
end
|
102
|
+
|
103
|
+
it 'test gcp_compute_client application name' do
|
104
|
+
client = connection.gcp_compute_client
|
105
|
+
client.is_a?(Google::Apis::ComputeV1::ComputeService).must_equal true
|
106
|
+
client.client_options.application_name.must_equal 'chef-inspec-train'
|
107
|
+
end
|
108
|
+
|
109
|
+
it 'test gcp_compute_client application version' do
|
110
|
+
client = connection.gcp_compute_client
|
111
|
+
client.is_a?(Google::Apis::ComputeV1::ComputeService).must_equal true
|
112
|
+
client.client_options.application_version.must_equal Train::VERSION
|
113
|
+
end
|
102
114
|
end
|
103
115
|
|
104
116
|
describe 'gcp_iam_client' do
|
@@ -114,6 +126,18 @@ describe 'gcp transport' do
|
|
114
126
|
client.is_a?(Google::Apis::IamV1::IamService).must_equal true
|
115
127
|
cache[:api_call].count.must_equal 0
|
116
128
|
end
|
129
|
+
|
130
|
+
it 'test gcp_iam_client application name' do
|
131
|
+
client = connection.gcp_iam_client
|
132
|
+
client.is_a?(Google::Apis::IamV1::IamService).must_equal true
|
133
|
+
client.client_options.application_name.must_equal 'chef-inspec-train'
|
134
|
+
end
|
135
|
+
|
136
|
+
it 'test gcp_iam_client application version' do
|
137
|
+
client = connection.gcp_iam_client
|
138
|
+
client.is_a?(Google::Apis::IamV1::IamService).must_equal true
|
139
|
+
client.client_options.application_version.must_equal Train::VERSION
|
140
|
+
end
|
117
141
|
end
|
118
142
|
|
119
143
|
describe 'gcp_project_client' do
|
@@ -129,6 +153,18 @@ describe 'gcp transport' do
|
|
129
153
|
client.is_a?(Google::Apis::CloudresourcemanagerV1::CloudResourceManagerService).must_equal true
|
130
154
|
cache[:api_call].count.must_equal 0
|
131
155
|
end
|
156
|
+
|
157
|
+
it 'test gcp_project_client application name' do
|
158
|
+
client = connection.gcp_project_client
|
159
|
+
client.is_a?(Google::Apis::CloudresourcemanagerV1::CloudResourceManagerService).must_equal true
|
160
|
+
client.client_options.application_name.must_equal 'chef-inspec-train'
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'test gcp_project_client application version' do
|
164
|
+
client = connection.gcp_project_client
|
165
|
+
client.is_a?(Google::Apis::CloudresourcemanagerV1::CloudResourceManagerService).must_equal true
|
166
|
+
client.client_options.application_version.must_equal Train::VERSION
|
167
|
+
end
|
132
168
|
end
|
133
169
|
|
134
170
|
describe 'gcp_storage_client' do
|
@@ -144,6 +180,18 @@ describe 'gcp transport' do
|
|
144
180
|
client.is_a?(Google::Apis::StorageV1::StorageService).must_equal true
|
145
181
|
cache[:api_call].count.must_equal 0
|
146
182
|
end
|
183
|
+
|
184
|
+
it 'test gcp_storage_client application name' do
|
185
|
+
client = connection.gcp_storage_client
|
186
|
+
client.is_a?(Google::Apis::StorageV1::StorageService).must_equal true
|
187
|
+
client.client_options.application_name.must_equal 'chef-inspec-train'
|
188
|
+
end
|
189
|
+
|
190
|
+
it 'test gcp_storage_client application version' do
|
191
|
+
client = connection.gcp_storage_client
|
192
|
+
client.is_a?(Google::Apis::StorageV1::StorageService).must_equal true
|
193
|
+
client.client_options.application_version.must_equal Train::VERSION
|
194
|
+
end
|
147
195
|
end
|
148
196
|
|
149
197
|
describe 'gcp_admin_client' do
|
@@ -159,6 +207,18 @@ describe 'gcp transport' do
|
|
159
207
|
client.is_a?(Google::Apis::AdminDirectoryV1::DirectoryService).must_equal true
|
160
208
|
cache[:api_call].count.must_equal 0
|
161
209
|
end
|
210
|
+
|
211
|
+
it 'test gcp_admin_client application name' do
|
212
|
+
client = connection.gcp_admin_client
|
213
|
+
client.is_a?(Google::Apis::AdminDirectoryV1::DirectoryService).must_equal true
|
214
|
+
client.client_options.application_name.must_equal 'chef-inspec-train'
|
215
|
+
end
|
216
|
+
|
217
|
+
it 'test gcp_admin_client application version' do
|
218
|
+
client = connection.gcp_admin_client
|
219
|
+
client.is_a?(Google::Apis::AdminDirectoryV1::DirectoryService).must_equal true
|
220
|
+
client.client_options.application_version.must_equal Train::VERSION
|
221
|
+
end
|
162
222
|
end
|
163
223
|
|
164
224
|
# test options override of env vars in connect
|
@@ -127,12 +127,6 @@ describe 'Train::Transports::VMware::Connection' do
|
|
127
127
|
end
|
128
128
|
end
|
129
129
|
|
130
|
-
describe '#local' do
|
131
|
-
it 'returns true' do
|
132
|
-
create_transport.connection.local?.must_equal true
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
130
|
describe '#platform' do
|
137
131
|
it 'returns correct platform details' do
|
138
132
|
platform = create_transport.connection.platform
|
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: 1.5.
|
4
|
+
version: 1.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|