Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make rspec-hiera-puppet compatible with Hiera 1.0.0 #4

Closed
wants to merge 1 commit into from

2 participants

duritong Michael Franz Aigner
duritong

This change removes the call to Backend.empty_answer which was removed
from Hiera in this merge: puppetlabs/hiera@f441151

See also jkinred/hiera-gpg@cc27a12
for the origin for this fix.

duritong duritong Make rspec-hiera-puppet compatible with Hiera 1.0.0
This change removes the call to Backend.empty_answer which was removed
from Hiera in this merge: puppetlabs/hiera@f441151

See also jkinred/hiera-gpg@cc27a12
for the origin for this fix.
037090c
Michael Franz Aigner amfranz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 13, 2012
  1. duritong

    Make rspec-hiera-puppet compatible with Hiera 1.0.0

    duritong authored
    This change removes the call to Backend.empty_answer which was removed
    from Hiera in this merge: puppetlabs/hiera@f441151
    
    See also jkinred/hiera-gpg@cc27a12
    for the origin for this fix.
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/hiera/backend/rspec_backend.rb
7 lib/hiera/backend/rspec_backend.rb
View
@@ -6,8 +6,7 @@ def initialize
end
def lookup(key, scope, order_override, resolution_type)
- answer = Backend.empty_answer(resolution_type)
-
+ answer = nil
Hiera.debug("Looking up #{key} in RSpec backend")
Backend.datasources(scope, order_override) do |source|
@@ -35,10 +34,10 @@ def lookup(key, scope, order_override, resolution_type)
case resolution_type
when :array
raise Exception, "Hiera type mismatch: expected Array and got #{new_answer.class}" unless new_answer.kind_of? Array or new_answer.kind_of? String
- answer << new_answer
+ answer = new_answer
when :hash
raise Exception, "Hiera type mismatch: expected Hash and got #{new_answer.class}" unless new_answer.kind_of? Hash
- answer = new_answer.merge answer
+ answer = new_answer
else
answer = new_answer
break
Something went wrong with that request. Please try again.