train-core 3.3.4 → 3.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d1528d472a38847644b9b12d7e7ebfd304e696bdfc50f7562b4b5bf387f5059
4
- data.tar.gz: 4913341d6670668289ccc69ab4d67335d4529da28fb449a0f9fcb1dc191b571b
3
+ metadata.gz: b6481551d7379b4a6cdee61568a1252e7feae2dc2d83def688417945eced8776
4
+ data.tar.gz: 3bec9acaea41dba70ed5c55cb7d6460d40e1c900002a172356419c80da222f7e
5
5
  SHA512:
6
- metadata.gz: 2ab551ae2ab9e8ef40628edb76cf77f5ce0391483a2ae3aaf9ade688244817286d48bf4d92f0f3ca78e488dcf71c6783808e98a56a226df0a09867b0a281fff9
7
- data.tar.gz: df2cc712d56b9e91239e6e10dd537b9233b0d97cfb8cb29771bb3539915f81df61523b222875791dd5dc8a9d0edbfa9f71f789cf7be74ee0164e0f504eba9c27
6
+ metadata.gz: '09b0f40e16fc0533bb474a460d3526fd767cacd2e2c18e35a6f9aa825e953adc7de241116d12a832c179c6e7383afbb7357ecf31bdeb75347854083fee328caa'
7
+ data.tar.gz: c1bcbb41f3c7e3e832f1adf70b5f02634906e6f40d8ed989ff7aafb56b2e5008ba4cab5ce483dc39badaf8142e8e685a7f262c1f154d28c078ce0d899d9561fc
@@ -34,16 +34,24 @@ module Train::Platforms::Detect::Helpers
34
34
  end
35
35
 
36
36
  def command_output(cmd)
37
- res = @backend.run_command(cmd).stdout
37
+ res = @backend.run_command(cmd)
38
+ stdout = res.stdout
39
+ stderr = res.stderr
38
40
  # When you try to execute command using ssh connction as root user and you have provided ssh user identity file
39
41
  # it gives standard output to login as authorised user other than root. To show this standard ouput as an error
40
42
  # to user we are matching the string of stdout and raising the error here so that user gets exact information.
41
- if @backend.class.to_s == "Train::Transports::SSH::Connection" && res =~ /Please login as the user/
42
- raise Train::UserError, "SSH failed: #{res}"
43
+ if @backend.class.to_s == "Train::Transports::SSH::Connection"
44
+ if stdout =~ /Please login as the user/
45
+ raise Train::UserError, "SSH failed: #{stdout}"
46
+ end
47
+
48
+ if stderr =~ /WARNING: Your password has expired/
49
+ raise Train::UserError, "SSH failed: #{stderr}"
50
+ end
43
51
  end
44
52
 
45
- res.strip! unless res.nil?
46
- res
53
+ stdout.strip! unless stdout.nil?
54
+ stdout
47
55
  end
48
56
 
49
57
  def unix_uname_s
@@ -357,7 +357,7 @@ module Train::Platforms::Detect::Specifications
357
357
  declare_instance("mac_os_x", "macOS X", "darwin") do
358
358
  cmd = unix_file_contents("/System/Library/CoreServices/SystemVersion.plist")
359
359
  @platform[:uuid_command] = "system_profiler SPHardwareDataType | awk '/UUID/ { print $3; }'"
360
- cmd =~ /Mac OS X/i
360
+ cmd =~ /Mac OS X|macOS/i
361
361
  end
362
362
 
363
363
  declare_instance("darwin", "Darwin", "darwin") do
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = "3.3.4".freeze
6
+ VERSION = "3.3.6".freeze
7
7
  end
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.3.4
4
+ version: 3.3.6
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: 2020-06-25 00:00:00.000000000 Z
11
+ date: 2020-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable