onering-report 0.6.10 → 0.6.11
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 +8 -8
- data/lib/facter/onering_properties_physical.rb +25 -23
- data/onering-report.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YWYxMzU3MDY5YTVmNTVmNzU3MWI5M2NmYzMxNzBiOGRhMzA4YzMyMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGI2ODAyZGY5ZWQyNDg0NWFiMTUzMGQxNjUxMDMyNjlmZWE3ZTQyZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDU0Y2YwNGJmNTE2MDRiOGE5ZDI1YjgxMDAxZGZhNGVhODYxZGY1MWQ3NDkz
|
10
|
+
MzU1Yzc3Nzc1YTA2MzJhMTYyYmJjODkyNWE0YjBjOThlOTEyMmM0NjYxN2Ji
|
11
|
+
ODM3YzgxMThhOGQ0MGRlNjMwYzAwZWYwOTExMTM0OTQ5OTMxNzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjdiNTgzZmQyZDA3NzMwZmFiMzNkZWI0NTQzMWEyMTY1MTk1Mzk0N2YxNDcw
|
14
|
+
ZTZhYTVkYjQxMzYxNTYxNzRhYmU1NjU4ZDgxMGFkNDIwODg1MjJlNGQ5ZDY1
|
15
|
+
OWU5YWUwNzBkOTBiNmE2YWI0NjU5YzkzYzg1ZDNlZDVlZWM1Zjc=
|
@@ -1,5 +1,30 @@
|
|
1
1
|
require 'timeout'
|
2
2
|
|
3
|
+
def count_ipmi_instances(cmd)
|
4
|
+
Dir['/proc/[0-9]*/cmdline'].select {|p| File.read(p).include?(cmd)}.count
|
5
|
+
end
|
6
|
+
|
7
|
+
ALLOWED_IPMI = 5
|
8
|
+
|
9
|
+
def ipmi_ok?
|
10
|
+
begin
|
11
|
+
ipmi = IPMI_PATH if defined? IPMI_PATH
|
12
|
+
ipmi ||= 'ipmiutil'
|
13
|
+
if count_ipmi_instances('ipmitool') > ALLOWED_IPMI
|
14
|
+
$stderr.puts "More then #{ALLOWED_IPMI} #{ipmi} instances found"
|
15
|
+
return false
|
16
|
+
end
|
17
|
+
Timeout::timeout(30) {
|
18
|
+
Facter::Util::Resolution.exec("#{ipmi} health 2> /dev/null | tail -n1 | grep failed").nil?
|
19
|
+
}
|
20
|
+
return true
|
21
|
+
rescue Timeout::Error
|
22
|
+
$stderr.puts "timed out while running #{ipmi}"
|
23
|
+
false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
|
3
28
|
Facter.add('site') do
|
4
29
|
setcode do
|
5
30
|
if File.size?('/etc/onering/static/site')
|
@@ -50,29 +75,6 @@ Facter.add('slot') do
|
|
50
75
|
end
|
51
76
|
end
|
52
77
|
|
53
|
-
def count_ipmi_instances(cmd)
|
54
|
-
Dir['/proc/[0-9]*/cmdline'].select {|p| File.read(p).include?(cmd)}.count
|
55
|
-
end
|
56
|
-
|
57
|
-
ALLOWED_IPMI = 5
|
58
|
-
|
59
|
-
def ipmi_ok?
|
60
|
-
begin
|
61
|
-
ipmi = IPMI_PATH if defined? IPMI_PATH
|
62
|
-
ipmi ||= 'ipmiutil'
|
63
|
-
if count_ipmi_instances('ipmitool') > ALLOWED_IPMI
|
64
|
-
$stderr.puts "More then #{ALLOWED_IPMI} #{ipmi} instances found"
|
65
|
-
return false
|
66
|
-
end
|
67
|
-
Timeout::timeout(30) {
|
68
|
-
Facter::Util::Resolution.exec("#{ipmi} health 2> /dev/null | tail -n1 | grep failed").nil?
|
69
|
-
}
|
70
|
-
rescue Timeout::Error
|
71
|
-
$stderr.puts "timed out while running #{ipmi}"
|
72
|
-
false
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
78
|
if ipmi_ok?
|
77
79
|
ipmi_lan = Facter::Util::Resolution.exec("ipmitool lan print 1 2> /dev/null")
|
78
80
|
|
data/onering-report.gemspec
CHANGED