train-core 1.5.4 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -10
- data/lib/train/platforms/detect/helpers/os_common.rb +3 -3
- data/lib/train/plugins/base_connection.rb +19 -0
- data/lib/train/version.rb +1 -1
- 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: d678392322f894b6807ecf2da658f788f7829009512ecca7f3b7fa0819c9b050
|
4
|
+
data.tar.gz: eb0b6e01142247f9a89270638df30554c579fa17e55535dd6436835ec48ea852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd5c26cdfc1a057e85129c15ebd559739aea1b27bc76846a7151936f47bb9afd4618fb25177e4e735c9f2cf39e4f470d9c2119109c73fe9cf5832f5f8816fbb6
|
7
|
+
data.tar.gz: 7b7e9250bec17278aa2626725d045de508f93c3e3fcc17fdf62fb0c9236a16a49fefa65cb044fcc7ee056467232c51344d5b3f5a6d260c513c8c03d1d79daef5
|
data/CHANGELOG.md
CHANGED
@@ -1,21 +1,28 @@
|
|
1
|
-
<!-- latest_release 1.5.
|
2
|
-
## [v1.5.
|
1
|
+
<!-- latest_release 1.5.6 -->
|
2
|
+
## [v1.5.6](https://github.com/inspec/train/tree/v1.5.6) (2018-11-01)
|
3
3
|
|
4
4
|
#### Merged Pull Requests
|
5
|
-
-
|
5
|
+
- Adds cached_client method in BaseConnection [#371](https://github.com/inspec/train/pull/371) ([dmccown](https://github.com/dmccown))
|
6
6
|
<!-- latest_release -->
|
7
7
|
|
8
|
-
<!-- release_rollup since=1.5.
|
9
|
-
### Changes since 1.5.
|
8
|
+
<!-- release_rollup since=1.5.4 -->
|
9
|
+
### Changes since 1.5.4 release
|
10
10
|
|
11
11
|
#### Merged Pull Requests
|
12
|
-
-
|
13
|
-
-
|
14
|
-
- Remove the legacy version bumping from the rakefile [#359](https://github.com/inspec/train/pull/359) ([tas50](https://github.com/tas50)) <!-- 1.5.2 -->
|
15
|
-
- Fixes the link pointing back to the plugin docs [#362](https://github.com/inspec/train/pull/362) ([cattywampus](https://github.com/cattywampus)) <!-- 1.5.1 -->
|
12
|
+
- Adds cached_client method in BaseConnection [#371](https://github.com/inspec/train/pull/371) ([dmccown](https://github.com/dmccown)) <!-- 1.5.6 -->
|
13
|
+
- Fix Cisco IOS detection when banners lack a `\r\n` [#372](https://github.com/inspec/train/pull/372) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 1.5.5 -->
|
16
14
|
<!-- release_rollup -->
|
17
15
|
|
18
16
|
<!-- latest_stable_release -->
|
17
|
+
## [v1.5.4](https://github.com/inspec/train/tree/v1.5.4) (2018-10-18)
|
18
|
+
|
19
|
+
#### Merged Pull Requests
|
20
|
+
- Fixes the link pointing back to the plugin docs [#362](https://github.com/inspec/train/pull/362) ([cattywampus](https://github.com/cattywampus))
|
21
|
+
- Remove the legacy version bumping from the rakefile [#359](https://github.com/inspec/train/pull/359) ([tas50](https://github.com/tas50))
|
22
|
+
- Adds Azure Vault Client [#351](https://github.com/inspec/train/pull/351) ([r-fennell](https://github.com/r-fennell))
|
23
|
+
- Correct example plugin link [#363](https://github.com/inspec/train/pull/363) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
24
|
+
<!-- latest_stable_release -->
|
25
|
+
|
19
26
|
## [v1.5.0](https://github.com/inspec/train/tree/v1.5.0) (2018-09-27)
|
20
27
|
|
21
28
|
#### Merged Pull Requests
|
@@ -23,7 +30,6 @@
|
|
23
30
|
- Adding GCP admin_client helper. [#349](https://github.com/inspec/train/pull/349) ([skpaterson](https://github.com/skpaterson))
|
24
31
|
- Plugins: Test harness, test fixture, docs, and local-type example [#356](https://github.com/inspec/train/pull/356) ([clintoncwolfe](https://github.com/clintoncwolfe))
|
25
32
|
- Bump minor version. [#357](https://github.com/inspec/train/pull/357) ([jquick](https://github.com/jquick))
|
26
|
-
<!-- latest_stable_release -->
|
27
33
|
|
28
34
|
## [v1.4.37](https://github.com/inspec/train/tree/v1.4.37) (2018-09-13)
|
29
35
|
|
@@ -69,17 +69,17 @@ module Train::Platforms::Detect::Helpers
|
|
69
69
|
return @cache[:cisco] if @cache.key?(:cisco)
|
70
70
|
res = command_output('show version')
|
71
71
|
|
72
|
-
m = res.match(
|
72
|
+
m = res.match(/Cisco IOS Software, [^,]+? \(([^,]+?)\), Version (\d+\.\d+)/)
|
73
73
|
unless m.nil?
|
74
74
|
return @cache[:cisco] = { version: m[2], model: m[1], type: 'ios' }
|
75
75
|
end
|
76
76
|
|
77
|
-
m = res.match(
|
77
|
+
m = res.match(/Cisco IOS Software, IOS-XE Software, [^,]+? \(([^,]+?)\), Version (\d+\.\d+\.\d+[A-Z]*)/)
|
78
78
|
unless m.nil?
|
79
79
|
return @cache[:cisco] = { version: m[2], model: m[1], type: 'ios-xe' }
|
80
80
|
end
|
81
81
|
|
82
|
-
m = res.match(
|
82
|
+
m = res.match(/Cisco Nexus Operating System \(NX-OS\) Software/)
|
83
83
|
unless m.nil?
|
84
84
|
v = res[/^\s*system:\s+version (\d+\.\d+)/, 1]
|
85
85
|
return @cache[:cisco] = { version: v, type: 'nexus' }
|
@@ -37,6 +37,25 @@ class Train::Plugins::Transport
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
# Returns cached client if caching enabled. Otherwise returns whatever is
|
41
|
+
# given in the block.
|
42
|
+
#
|
43
|
+
# @example
|
44
|
+
#
|
45
|
+
# def demo_client
|
46
|
+
# cached_client(:api_call, :demo_connection) do
|
47
|
+
# DemoClient.new(args)
|
48
|
+
# end
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @param [symbol] type one of [:api_call, :file, :command]
|
52
|
+
# @param [symbol] key for your cached connection
|
53
|
+
def cached_client(type, key)
|
54
|
+
return yield unless cache_enabled?(type)
|
55
|
+
|
56
|
+
@cache[type][key] ||= yield
|
57
|
+
end
|
58
|
+
|
40
59
|
def cache_enabled?(type)
|
41
60
|
@cache_enabled[type.to_sym]
|
42
61
|
end
|
data/lib/train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: train-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.6
|
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-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-shellout
|