hiera-examiner 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/hiera-examiner +13 -6
- data/lib/hiera-examiner.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b9868f58b06234f63addbc0894cc853dafa883f
|
4
|
+
data.tar.gz: 71010790ae816f88e3bf7b2d7d2a4cdc888b3166
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10cec0fbc78bc7733dccb78053107fd58954f756685a0166a1ee8e4a64f23708b98ec2ff8905d9a0d1461a57ee4b16dd981e06ef35e9550dddc94d9e2e584e92
|
7
|
+
data.tar.gz: 5d0ee0e296533d3810f0ea55d8cf458a6be86416442ff28e4a369b592e41053cdd0083566ef20ece43109a41d6d495a4bdbdcd719e10232e5a13e5e56cf28495
|
data/bin/hiera-examiner
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'hiera-examiner'
|
4
|
-
examiner = HieraExaminer.new()
|
5
4
|
|
6
|
-
if (ARGV[
|
7
|
-
HieraExaminer.new(
|
8
|
-
|
9
|
-
|
10
|
-
|
5
|
+
if (ARGV[0])
|
6
|
+
examiner = HieraExaminer.new()
|
7
|
+
if (ARGV[1])
|
8
|
+
HieraExaminer.new(ARGV[1])
|
9
|
+
end
|
10
|
+
|
11
|
+
examiner.explain(ARGV[0])
|
12
|
+
else
|
13
|
+
puts 'hiera-examiner Usage:'
|
14
|
+
puts 'hiera-examiner <key> [path]'
|
15
|
+
puts '\tkey:\tHiera key to examine'
|
16
|
+
puts '\tpath:\tPath to hiera config file to use. Default: /vagrant/puppet/hiera/hiera.yaml'
|
17
|
+
end
|
data/lib/hiera-examiner.rb
CHANGED
@@ -82,8 +82,8 @@ class HieraExaminer
|
|
82
82
|
yamlVal = yamlMap[:val]
|
83
83
|
yamlFile = yamlMap[:file]
|
84
84
|
|
85
|
-
if (hieraVal.empty?()
|
86
|
-
|
85
|
+
if (hieraVal.empty?() || (!yamlVal || yamlVal.empty?()))
|
86
|
+
return 'MISSING'.magenta.blink
|
87
87
|
elsif (yamlVal.index(startExp))
|
88
88
|
if (showSource)
|
89
89
|
res = explainDetail(yamlVal, "#{prefix}|", true, yamlFile)
|