train-core 3.8.7 → 3.8.9

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: 0e3153fa7d5928d42936093a793c001b1c0988a10c320edba2b887f63a1ec4ab
4
- data.tar.gz: 3da18aa2c5e772b2881a670c23074c1775d1d560a87576fdd15d885e4e954c79
3
+ metadata.gz: edb9b675408e81e6b24133e0fa0a859d19f727091fda4a93a7b16691addb20cf
4
+ data.tar.gz: 628ff896313d2ad8113a01c018864840fc341f2239246c85e8d2c47a921354fb
5
5
  SHA512:
6
- metadata.gz: c64082d00fb778a8326543df95888d03c98a4223a54dfc2073087c7dcef695ca9ca9d8e2c40f5980a9d726431b431283e5a205ba2cdbe1ec2c9a38ce8966be0b
7
- data.tar.gz: b10c8793c74e7ae271eaae49e94a7222c1b347ad808d3a16b68f23564c03a6fec5baea0bf8209a99330f3dfcfc76a61a5ef1b1b5df8ff403d995c1fda37f7536
6
+ metadata.gz: d37f24464d367c55bfa73f285804b2428203219452a04d58bab4623adff91bc834ea4e27a1a1eb67aa813b3ab99ea4a16cecbe805dd92125e5f8df3e4308862f
7
+ data.tar.gz: 853c5858f859944c9e5b0777191d370ed062441986af9ab86e86b532188145dd1df55a1fc0ffea4cd6113545420783f3f489eb0a8e6db50851a5a6d2ebc4765e
data/lib/train/errors.rb CHANGED
@@ -38,6 +38,9 @@ module Train
38
38
  # Exception for when no platform can be detected.
39
39
  class PlatformDetectionFailed < Error; end
40
40
 
41
+ # Exception for when no uuid for the platform can be detected.
42
+ class PlatformUuidDetectionFailed < Error; end
43
+
41
44
  # Exception for when a invalid cache type is passed.
42
45
  class UnknownCacheType < Error; end
43
46
 
@@ -122,7 +122,6 @@ module Train::Platforms::Detect::Helpers
122
122
  end
123
123
 
124
124
  def unix_uuid_from_machine_file
125
- # require 'pry';binding.pry
126
125
  %W{
127
126
  /etc/chef/chef_guid
128
127
  #{ENV["HOME"]}/.chef/chef_guid
@@ -20,12 +20,13 @@ module Train::Platforms::Detect
20
20
  elsif @platform.windows?
21
21
  windows_uuid
22
22
  else
23
- if @platform[:uuid_command]
23
+ # Checking "unknown" :uuid_command which is set for mock transport.
24
+ if @platform[:uuid_command] && !@platform[:uuid_command] == "unknown"
24
25
  result = @backend.run_command(@platform[:uuid_command])
25
26
  return uuid_from_string(result.stdout.chomp) if result.exit_status == 0 && !result.stdout.empty?
26
27
  end
27
28
 
28
- raise "Could not find platform uuid! Please set a uuid_command for your platform."
29
+ raise Train::PlatformUuidDetectionFailed.new("Could not find platform uuid! Please set a uuid_command for your platform.")
29
30
  end
30
31
  end
31
32
  end
data/lib/train/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
3
3
 
4
4
  module Train
5
- VERSION = "3.8.7".freeze
5
+ VERSION = "3.8.9".freeze
6
6
  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.8.7
4
+ version: 3.8.9
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: 2022-02-01 00:00:00.000000000 Z
11
+ date: 2022-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable