genesis_collector 0.1.37 → 0.1.38

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: ca15da7c07b0645913ad2130c17de497adb68417
4
- data.tar.gz: c55108b2bb2f6bbaa1abcc87f34ba254379c3cce
3
+ metadata.gz: 6ce03ac802920f9d1f795c7d10c709b0d8e827d4
4
+ data.tar.gz: 99b013aafd16152ec22166fc77db3f88d7200c4f
5
5
  SHA512:
6
- metadata.gz: edf68752cf4410409e8d6ebc067621f0a11e74e0a38b0ef59c4c179697473759b2749bbeb9ddfde5c58150a7d04e44877318c9c2d93f1f91287eb263749be9f8
7
- data.tar.gz: 908e0e74058165dfa17404240848f793d14759dc1ec34e5c5e00f1f474224b20f2d8bf2551da93568beaaec19d4ecb1260d2164a7c957ed40ce68c9b7d900c55
6
+ metadata.gz: 8c0b936e3906a7a048f9a97acf8d1938228f0097e5f00d1a5c94dc50bc3a890e73ad90a642232e9a3c903a2d58cd58dfbf7e7317a79282ea5c64318ef2a3be05
7
+ data.tar.gz: 0e05d3f2702559b057d5234be03328b49d2b87547dc7c0327daed8a1152b90af46feb3c31d29aab1df2180a4c680b14d65b2c1ceab4616cf09691d752a33f0f7
@@ -129,7 +129,7 @@ module GenesisCollector
129
129
 
130
130
  def shellout_with_timeout(command, timeout = 2)
131
131
  response = `timeout #{timeout} #{command}`
132
- unless $CHILD_STATUS.success?
132
+ if $CHILD_STATUS.exitstatus == 124 # timeout exits 124 on timeout
133
133
  STDERR.puts "Call to #{command} timed out after #{timeout} seconds"
134
134
  return ''
135
135
  end
@@ -16,7 +16,7 @@ module GenesisCollector
16
16
  if d[:dev].start_with?("/dev/sd")
17
17
  d[:slot] = get_scsi_slot(d[:dev])
18
18
  d[:uuid] = disk_uuid(d[:dev])
19
- d[:status] = "unhealthy" unless disk_healthy(d[:dev])
19
+ d[:status] = disk_healthy(d[:dev]) ? "healthy" : "unhealthy"
20
20
  end
21
21
  end
22
22
  @payload[:disks].delete_if { |d| d[:serial_number].nil? }
@@ -29,9 +29,8 @@ module GenesisCollector
29
29
  private
30
30
 
31
31
  def disk_healthy(disk)
32
- short_tests = shellout_with_timeout("smartctl -H #{disk}", 5)
33
-
34
- short_tests =~ /result: PASSED/
32
+ shellout_with_timeout("smartctl -H #{disk}", 5)
33
+ $CHILD_STATUS.success?
35
34
  rescue
36
35
  true
37
36
  end
@@ -1,3 +1,3 @@
1
1
  module GenesisCollector
2
- VERSION = '0.1.37'
2
+ VERSION = '0.1.38'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: genesis_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.37
4
+ version: 0.1.38
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Radcliffe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler