hiera-simulator 0.2.1 → 0.2.2

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: a409ed848956ad385eaa26c1ca9ceaf758deb132
4
- data.tar.gz: df0f290c98e20878842060ef1f60ac87d7635ccf
3
+ metadata.gz: 0916abf46cbd4952f409917b63b12f650429e5ba
4
+ data.tar.gz: 2a6ad789894a3010e9791139c340000543257d42
5
5
  SHA512:
6
- metadata.gz: 8fff178d310a6ecb83ca7cb109811003d0f945ebeec248b47489a6be0e2d726690f2fbeb63e162e50cd82131de45e3a9f1379dac29e00723006809ad960c407d
7
- data.tar.gz: 0b612f1d2de47c239e6bddcc5c4228d3aedc38adfca4b418f90a57d03c388276db7831692f333cbf0adcd759404f8352604c9b64c514d1622a8157126778600d
6
+ metadata.gz: bf6660801c35ab1258daf3040dc939438d7b495d85b35131500cb924ac443de5535545b878d0de2dc5cea3a53e486fd1424e801f3a5f11fefcc1b9c75f447e57
7
+ data.tar.gz: 21bf2b36c8a84e42348d08d9a31d7ec32a53cbd9e731529598e763f2bdca0d01569d2351c0e8b2aaba90bd92175cf81abd0b552ece8d0a902dc3fb9ecf5852a7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- hiera-simulator (0.2.1)
4
+ hiera-simulator (0.2.2)
5
5
  bundler
6
6
  deep_merge
7
7
  hiera
@@ -14,7 +14,7 @@ GEM
14
14
  specs:
15
15
  deep_merge (1.0.1)
16
16
  diff-lcs (1.2.5)
17
- hiera (1.3.4)
17
+ hiera (3.1.1)
18
18
  json_pure
19
19
  httparty (0.13.7)
20
20
  json (~> 1.8)
@@ -41,7 +41,6 @@ PLATFORMS
41
41
  ruby
42
42
 
43
43
  DEPENDENCIES
44
- hiera
45
44
  hiera-simulator!
46
45
  rspec (>= 3.0.0)
47
46
 
data/README.md CHANGED
@@ -45,6 +45,7 @@ Here are the important ones:
45
45
 
46
46
  | Version | Notes |
47
47
  |---------|-------|
48
+ | 0.2.2 | Raise error directly if PuppetDB responds with code 200 but has an error message |
48
49
  | 0.2.1 | Remove PuppetDB hiera backend support, add --[no-]stringify-facts command line option |
49
50
  | 0.2.0 | Add support for PuppetDB API v4 |
50
51
  | 0.1.0 | Initial release |
@@ -40,6 +40,18 @@ module HieraSimulator
40
40
  def facts_common(uri)
41
41
  reply = response(uri)
42
42
 
43
+ # Check for an error from PuppetDB despite return code 200
44
+ if reply.is_a?(Hash) && reply.key?('error')
45
+ message = "Error from PuppetDB: #{reply['error']}"
46
+ raise HieraSimulator::FactLookupError, message
47
+ end
48
+
49
+ # Check for unexpected data - we expect an array
50
+ unless reply.is_a?(Array)
51
+ message = "Unexpected data from PuppetDB: Expected Array got #{reply.class}"
52
+ raise HieraSimulator::FactSourceError, message
53
+ end
54
+
43
55
  # Stringify facts if needed (old hiera, old PuppetDB)
44
56
  if @stringify_facts
45
57
  result = {}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-simulator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Paulisse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-04 00:00:00.000000000 Z
11
+ date: 2016-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake