diff options
author | Seth Chisamore <schisamo@opscode.com> | 2013-03-17 21:53:56 -0400 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2013-04-11 14:25:45 -0700 |
commit | 64b1a49d4a03916402df57197aa97485820b842d (patch) | |
tree | 54d5525eb21c6c7672267ed8361a56c82ce29bb5 /lib/chef/encrypted_data_bag_item.rb | |
parent | 67ac0783ba83eb6c9c1259cb4d9fc8987a9eb15b (diff) | |
download | chef-64b1a49d4a03916402df57197aa97485820b842d.tar.gz |
[CHEF-4011] move default secret file path to Chef::Config
* Remove references to DEFAULT_SECRET_FILE from
`Chef::EncryptedDataBagItem`.
* Add new `:encrypted_data_bag_secret` value to `Chef::Config`
* Ensure Chef::Config[:encrypted_data_bag_secret] is nil if the secret
does not exist at the default path.
* Updated test coverage in `config_spec` and
`encrypted_data_bag_item_spec`.
Diffstat (limited to 'lib/chef/encrypted_data_bag_item.rb')
-rw-r--r-- | lib/chef/encrypted_data_bag_item.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/chef/encrypted_data_bag_item.rb b/lib/chef/encrypted_data_bag_item.rb index b73e8d5f62..1f12277e87 100644 --- a/lib/chef/encrypted_data_bag_item.rb +++ b/lib/chef/encrypted_data_bag_item.rb @@ -48,7 +48,6 @@ require 'open-uri' # such nodes in the infrastructure. # class Chef::EncryptedDataBagItem - DEFAULT_SECRET_FILE = "/etc/chef/encrypted_data_bag_secret" ALGORITHM = 'aes-256-cbc' class UnsupportedEncryptedDataBagItemFormat < StandardError @@ -297,7 +296,7 @@ class Chef::EncryptedDataBagItem end def self.load_secret(path=nil) - path = path || Chef::Config[:encrypted_data_bag_secret] || DEFAULT_SECRET_FILE + path ||= Chef::Config[:encrypted_data_bag_secret] secret = case path when /^\w+:\/\// # We have a remote key |