libraries/chef_artifact.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  data_bag [String]
# @param  data_bag_item [String]
# 
# @raise [Chef::Artifact::DataBagEncryptionError] when the data bag cannot be decrypted
#   or transformed into a Mash for some reason (Chef 10 vs Chef 11 data bag changes).
# 
# @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(data_bag, data_bag_item)
        Mash.from_hash(Chef::EncryptedDataBagItem.load(data_bag, data_bag_item).to_hash)
      rescue Net::HTTPServerException => e
        nil
      rescue NoMethodError
        raise DataBagEncryptionError.new
      end
def encrypted_data_bag_item ( data_bag , data_bag_item ) Mash . from_hash ( Chef :: EncryptedDataBagItem . load ( data_bag , data_bag_item ) . to_hash ) rescue Net :: HTTPServerException => e 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::Artifact::DataBagEncryptionError] when the data bag cannot be decrypted or transformed into a Mash for some reason (Chef 10 vs Chef 11 data bag changes).
[ Chef :: Artifact :: DataBagEncryptionError ] when the data bag cannot be decrypted or transformed into a Mash for some reason ( Chef 10 vs Chef 11 data bag changes ) .
data_bag
data_bag_item
None