genesis_collector 0.1.39 → 0.1.40

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: 786f6dd29cd14a5639c1e4eec5fe7982080437b9
4
- data.tar.gz: 8190331cde2e80f19bf1a28441fa9ae7f7bc341c
3
+ metadata.gz: d084e72924bc0a833ce5989ecae28f9df02c7830
4
+ data.tar.gz: 9ca1ba65742ee1eed751f897ebfc53ee7047de7f
5
5
  SHA512:
6
- metadata.gz: 149431d6981a13bae50971fd274e232769cbcfc2576a7cf3aab5a3b711624490086c4d2f99432177b952ff4e84aaa2efd8cce0e798ff9d668182ec15b3f5d661
7
- data.tar.gz: 79a1611e350c4922e583e99b133e0a0151403be9a70c321c3617399a6d6c8f22be53badf0dc8801cf827b35a636aef1f5b5f74929b058a75d95f7c5bb085cbf2
6
+ metadata.gz: 86c46b8a7393642168b512564507dd5faee75970eddd57b1ed7dbf53e8d87dd153e76e56c1c422c49176ead47070becdea4905430f62e3b71407f1617637ee85
7
+ data.tar.gz: fe467b952c545511b34b32a1c8fe6fc9851ea8ccb01046e1c97d6b391df6c106bf70f464de9d402f120ad0bf8569d8ee94ac73255397cf48f39467be0fa93015
@@ -195,7 +195,7 @@ module GenesisCollector
195
195
  end
196
196
 
197
197
  def read_dmi(key)
198
- value = shellout_with_timeout("dmidecode -s #{key}").gsub(/^#.+$/, '').strip
198
+ value = shellout_with_timeout("dmidecode -s #{key}").gsub(/^#.+$/, '').gsub(/^Invalid entry length.*$/,'').strip
199
199
  value = '' if '0123456789' == value # sometimes the firmware is broken
200
200
  value.empty? ? nil : value
201
201
  end
@@ -3,23 +3,27 @@ module GenesisCollector
3
3
 
4
4
  def collect_ipmi
5
5
  @payload[:ipmi] = {
6
- address: read_ipmi_attribute('IP Address'),
7
- netmask: read_ipmi_attribute('Subnet Mask'),
8
- mac: read_ipmi_attribute('MAC Address'),
9
- gateway: read_ipmi_attribute('Default Gateway IP')
6
+ address: read_ipmi_lan_attribute('IP Address'),
7
+ netmask: read_ipmi_lan_attribute('Subnet Mask'),
8
+ mac: read_ipmi_lan_attribute('MAC Address'),
9
+ gateway: read_ipmi_lan_attribute('Default Gateway IP')
10
10
  }
11
11
  end
12
12
 
13
13
  private
14
14
 
15
- def read_ipmi_attribute(key)
15
+ def read_ipmi_lan_attribute(key)
16
16
  @ipmi_lan_output ||= shellout_with_timeout('ipmitool lan print', 10)
17
- @ipmi_lan_output.match(/#{key}\s*:\s*(\S+)$/)[1] || 'unknown'
17
+ match = @ipmi_lan_output.match(/#{key}\s*:\s*(\S+)$/)
18
+ raise "IPMI lan print output missing key: #{key}" if match.nil?
19
+ match[1]
18
20
  end
19
21
 
20
22
  def read_ipmi_fru(key)
21
23
  @ipmi_fru_output ||= shellout_with_timeout('ipmitool fru')
22
- @ipmi_fru_output.match(/#{key}\s*:\s*(\S+)$/)[1] || 'unknown'
24
+ match = @ipmi_fru_output.match(/#{key}\s*:\s*(\S+)$/)
25
+ raise "IPMI fru output missing key: #{key}" if match.nil?
26
+ match[1]
23
27
  end
24
28
 
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module GenesisCollector
2
- VERSION = '0.1.39'
2
+ VERSION = '0.1.40'
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.39
4
+ version: 0.1.40
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-28 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler