onering-report-plugins 0.0.8 → 0.0.9

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.
@@ -1,6 +1,12 @@
1
1
  Facter.add('signature') do
2
2
  setcode do
3
- if Facter.value('macaddress')
3
+ if File.size?("/etc/onering/signature")
4
+ parts = File.read("/etc/onering/signature").split("\n").
5
+ reject{|i| i =~ /^\s*#/ }.
6
+ reject{|i| i.strip.chomp.empty? }.
7
+ collect{|i| i.gsub(/\H/,'') }
8
+
9
+ elsif Facter.value('macaddress')
4
10
  if Facter.value('is_virtual')
5
11
  if File.exists?('/sys/hypervisor/uuid')
6
12
  parts = [
@@ -14,9 +20,16 @@ Facter.add('signature') do
14
20
  Facter.value('macaddress').strip.delete(':')
15
21
  ]
16
22
  end
23
+
24
+ else
25
+ if Facter.value('ipaddress')
26
+ parts = [
27
+ Facter.value('ipaddress').split(',').first.strip.chomp.delete('.')
28
+ ].compact
29
+ end
17
30
  end
18
31
 
19
- (parts ? parts.collect{|i| i.upcase }.join('-') : nil)
32
+ (parts && !parts.empty? ? parts.collect{|i| i.upcase }.join('-') : nil)
20
33
  end
21
34
  end
22
35
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onering-report-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: onering-client
16
- requirement: &19994480 !ruby/object:Gem::Requirement
16
+ requirement: &8116020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19994480
24
+ version_requirements: *8116020
25
25
  description: Base plugins for providing system information via the Onering client
26
26
  utility
27
27
  email: ghetzel@outbrain.com