train-core 3.10.1 → 3.10.8
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd9123fc8c77d6d2913633bb544aae171f440d3a0558bacda3136fa62d856661
|
4
|
+
data.tar.gz: b8e558c2c7fa1479725228f1745ff5ed610f6975babc43cb07bbfb6289f41806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ed3576117bf704f08d0170e3f9c9d08e20da634300f02b986aaa8fb18094d0b027d9943bcc04043d986102e641ed7c09a4ed163ca6b9f8de1488d3063043721
|
7
|
+
data.tar.gz: deb114924bc9f537bb8a8c4df1f0b48936c8b7e081539109b886b4c26f994a6f96b214d514d2109ab75b526e2328473fb56f323e0746a28f8cf4cfce4df8e334
|
@@ -106,6 +106,7 @@ module Train::Platforms::Detect::Helpers
|
|
106
106
|
m = res.match(/Cisco Nexus Operating System \(NX-OS\) Software/)
|
107
107
|
unless m.nil?
|
108
108
|
v = res[/^\s*system:\s+version (\d+\.\d+)/, 1]
|
109
|
+
v ||= res[/NXOS: version (\d+\.\d+)/, 1]
|
109
110
|
return @cache[:cisco] = { version: v, type: "nexus" }
|
110
111
|
end
|
111
112
|
|
@@ -116,6 +117,7 @@ module Train::Platforms::Detect::Helpers
|
|
116
117
|
(unix_uuid_from_chef ||
|
117
118
|
unix_uuid_from_machine_file ||
|
118
119
|
uuid_from_command ||
|
120
|
+
uuid_from_containerized_system ||
|
119
121
|
raise(Train::TransportError, "Cannot find a UUID for your node."))
|
120
122
|
end
|
121
123
|
|
@@ -154,6 +156,28 @@ module Train::Platforms::Detect::Helpers
|
|
154
156
|
uuid_from_string(result.stdout.chomp) if result.exit_status == 0 && !result.stdout.empty?
|
155
157
|
end
|
156
158
|
|
159
|
+
# This will run if anyone is running Train with local transport inside docker container
|
160
|
+
# This is fallback plan, if other ways of getting uuid fails for local transport running inside docker container
|
161
|
+
# TODO: This needs to be improved to support other container runtime
|
162
|
+
def uuid_from_containerized_system
|
163
|
+
uuid = nil
|
164
|
+
|
165
|
+
if File.exist?("/proc/self/cgroup")
|
166
|
+
cmd = @backend.run_command("head -1 /proc/self/cgroup|cut -d/ -f3")
|
167
|
+
unless cmd.stdout.strip.empty?
|
168
|
+
uuid = cmd.stdout.strip
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
if uuid.nil? && File.exist?("/proc/self/mountinfo")
|
173
|
+
cmd = @backend.run_command("cat /proc/self/mountinfo | grep -i /docker/containers/ | head -n 1 | awk '{print $4}' | awk NF=NF FS=/ | awk '{print $3}'")
|
174
|
+
unless cmd.stdout.strip.empty?
|
175
|
+
uuid = cmd.stdout.strip
|
176
|
+
end
|
177
|
+
end
|
178
|
+
uuid
|
179
|
+
end
|
180
|
+
|
157
181
|
# This hashes the passed string into SHA1.
|
158
182
|
# Then it downgrades the 160bit SHA1 to a 128bit
|
159
183
|
# then we format it as a valid UUIDv5.
|
@@ -383,7 +383,7 @@ module Train::Platforms::Detect::Specifications
|
|
383
383
|
def self.load_other
|
384
384
|
plat.family("arista_eos").title("Arista EOS Family").in_family("os")
|
385
385
|
.detect do
|
386
|
-
|
386
|
+
!@backend.run_command("show version").stdout.match(/Arista/).nil?
|
387
387
|
end
|
388
388
|
|
389
389
|
declare_instance("arista_eos", "Arista EOS", "arista_eos") do
|
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: 3.10.
|
4
|
+
version: 3.10.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef InSpec Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '1.2'
|
88
88
|
- - "<"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
90
|
+
version: '5.0'
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -97,7 +97,7 @@ dependencies:
|
|
97
97
|
version: '1.2'
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: '
|
100
|
+
version: '5.0'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: net-ssh
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,7 +107,7 @@ dependencies:
|
|
107
107
|
version: '2.9'
|
108
108
|
- - "<"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '8.0'
|
111
111
|
type: :runtime
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -117,7 +117,7 @@ dependencies:
|
|
117
117
|
version: '2.9'
|
118
118
|
- - "<"
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: '
|
120
|
+
version: '8.0'
|
121
121
|
description: A minimal Train with a backends for ssh and winrm.
|
122
122
|
email:
|
123
123
|
- inspec@chef.io
|