lib/garcon/chef/secret_bag.rb
# Loads an EncryptedDataBagItem from the Chef server and
# turns it into a Chef::Mash, giving it indifferent access. Returns
# nil when a data bag item is not found.
#
# @param [String] dbag
# @param [String] dbag_item
#
# @raise [Chef::Garcon::DataBagEncryptionError]
#   When the data bag cannot be decrypted or transformed into a Mash for
#   some reason.
#
# @return [Chef::Mash]
#
Loads an EncryptedDataBagItem from the Chef server and
turns it into a Chef::Mash, giving it indifferent access. Returns
nil when a data bag item is not found.
Loads an EncryptedDataBagItem from the Chef server and turns it into a Chef :: Mash giving it indifferent access . Returns nil when a data bag item is not found .
def encrypted_data_bag_item(dbag, dbag_item)
      Mash.from_hash(Chef::EncryptedDataBagItem.load(dbag, dbag_item).to_hash)
    rescue Net::HTTPServerException
      nil
    rescue NoMethodError
      raise DataBagEncryptionError.new
    end
def encrypted_data_bag_item ( dbag , dbag_item ) Mash . from_hash ( Chef :: EncryptedDataBagItem . load ( dbag , dbag_item ) . to_hash ) rescue Net :: HTTPServerException nil rescue NoMethodError raise DataBagEncryptionError . new end
Loads an EncryptedDataBagItem from the Chef server and
turns it into a Chef::Mash, giving it indifferent access.
Loads an EncryptedDataBagItem from the Chef server and turns it into a Chef :: Mash giving it indifferent access .
None
Chef::Mash
[Chef::Garcon::DataBagEncryptionError] When the data bag cannot be decrypted or transformed into a Mash for some reason.
[ Chef :: Garcon :: DataBagEncryptionError ] When the data bag cannot be decrypted or transformed into a Mash for some reason .
dbag
<not_specific>
dbag_item
<not_specific>
<not_specific>
None