train 1.4.0 → 1.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f63093de8fc4481a4c9138635607941fc2c58d79
|
4
|
+
data.tar.gz: 6cb07cade32d161a378fbd65e01deda7e6601b73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc3669cede169bc9b1d6279ad131e6f530e5030f5eec62cff45fd3ed67db8fb9110c3290fc2da2cc0a60bfca8bd7a6f6e94139679e48b2e95833dac91bfa2d13
|
7
|
+
data.tar.gz: ea3b12df05af8e99a3999d379e67460f1d01f3c06217c6c4b2a28fc7e9e389319092c204ab5de0910a5c3f90aeb334657e421d73147bf02934ff3f96745a0874
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [1.4.
|
4
|
-
[Full Changelog](https://github.com/chef/train/compare/v1.
|
3
|
+
## [1.4.1](https://github.com/chef/train/tree/1.4.1) (2018-04-19)
|
4
|
+
[Full Changelog](https://github.com/chef/train/compare/v1.4.0...1.4.1)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Add UUID for Cisco IOS and Nexus devices [\#285](https://github.com/chef/train/pull/285) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
9
|
+
- Add handling for privileged exec mode [\#284](https://github.com/chef/train/pull/284) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
10
|
+
|
11
|
+
## [v1.4.0](https://github.com/chef/train/tree/v1.4.0) (2018-04-12)
|
12
|
+
[Full Changelog](https://github.com/chef/train/compare/v1.3.0...v1.4.0)
|
5
13
|
|
6
14
|
**Closed issues:**
|
7
15
|
|
@@ -9,6 +17,7 @@
|
|
9
17
|
|
10
18
|
**Merged pull requests:**
|
11
19
|
|
20
|
+
- Release 1.4.0 [\#282](https://github.com/chef/train/pull/282) ([jquick](https://github.com/jquick))
|
12
21
|
- Add CloudLinux as a detected platform [\#281](https://github.com/chef/train/pull/281) ([tarcinil](https://github.com/tarcinil))
|
13
22
|
- Move Cisco IOS connection under SSH transport [\#279](https://github.com/chef/train/pull/279) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
14
23
|
- Initialize FileManager using '@service' [\#278](https://github.com/chef/train/pull/278) ([marcparadise](https://github.com/marcparadise))
|
@@ -23,6 +23,13 @@ class Train::Transports::SSH
|
|
23
23
|
"ssh://#{@user}@#{@host}:#{@port}"
|
24
24
|
end
|
25
25
|
|
26
|
+
def unique_identifier
|
27
|
+
result = run_command_via_connection('show inventory').stdout
|
28
|
+
result.split("\r\n\r\n").each do |section|
|
29
|
+
return section.split('SN: ')[1].strip if section.include?('Chassis')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
26
33
|
private
|
27
34
|
|
28
35
|
def establish_connection
|
@@ -38,7 +45,11 @@ class Train::Transports::SSH
|
|
38
45
|
|
39
46
|
# Escalate privilege to enable mode if password is given
|
40
47
|
if @enable_password
|
41
|
-
|
48
|
+
# This verifies we are not in privileged exec mode before running the
|
49
|
+
# enable command. Otherwise, the password will be in history.
|
50
|
+
if run_command_via_connection('show privilege').stdout.split[-1] != '15'
|
51
|
+
run_command_via_connection("enable\r\n#{@enable_password}")
|
52
|
+
end
|
42
53
|
end
|
43
54
|
|
44
55
|
# Prevent `--MORE--` by removing terminal length limit
|
data/lib/train/version.rb
CHANGED
@@ -31,6 +31,16 @@ describe 'CiscoIOSConnection' do
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
+
describe '#unique_identifier' do
|
35
|
+
it 'returns the correct identifier' do
|
36
|
+
output = "NAME: \"Chassis\", DESCR: \"Cisco 7206VXR, 6-slot chassis\"\r\nPID: CISCO7206VXR , VID: , SN: 4279256517 \r\n\r\nNAME: \"NPE400 0\", DESCR: \"Cisco 7200VXR Network Processing Engine NPE-400\"\r\nPID: NPE-400 , VID: , SN: 11111111 \r\n\r\nNAME: \"module 0\", DESCR: \"I/O FastEthernet (TX-ISL)\"\r\nPID: C7200-IO-FE-MII/RJ45=, VID: , SN: 4294967295 \r\n\r\nNAME: \"Power Supply 1\", DESCR: \"Cisco 7200 AC Power Supply\"\r\nPID: PWR-7200-AC , VID: , SN: \r\n\r\nNAME: \"Power Supply 2\", DESCR: \"Cisco 7200 AC Power Supply\"\r\nPID: PWR-7200-AC , VID: , SN: "
|
37
|
+
Train::Transports::SSH::CiscoIOSConnection.any_instance
|
38
|
+
.expects(:run_command_via_connection).with('show inventory')
|
39
|
+
.returns(OpenStruct.new(stdout: output))
|
40
|
+
connection.unique_identifier.must_equal('4279256517')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
34
44
|
describe '#format_result' do
|
35
45
|
it 'returns correctly when result is `good`' do
|
36
46
|
output = 'good'
|
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.4.
|
4
|
+
version: 1.4.1
|
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-04-
|
11
|
+
date: 2018-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|