Class: ChefVaultRetry::Item

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-vault-retry.rb

Class Method Summary collapse

Class Method Details

.load(v, i, retries = 40) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/chef-vault-retry.rb', line 24

def self.load(v, i, retries=40)
  retries.times do
    begin
      return ChefVault::Item.load(v, i)
    rescue ChefVault::Exceptions::SecretDecryption
      puts "SecretDecryption exception raised; "\
           "please refresh vault item (#{v}/#{i})"
      sleep 30
      next
    end
  end
  fail "Failed after #{retries} attempts to decrypt #{v}/#{i}"
end