diff --git a/lib/chef-vault/item_keys.rb b/lib/chef-vault/item_keys.rb index dbf6125..65c7f89 100644 --- a/lib/chef-vault/item_keys.rb +++ b/lib/chef-vault/item_keys.rb @@ -53,7 +53,7 @@ def include?(key) ckey = @cache[key] return (ckey ? true : false) unless ckey.nil? # check if the key is saved in sparse mode - return true unless sparse_key(sparse_id(key)).nil? + return true if sparse? && sparse_key(sparse_id(key)) # fallback to non-sparse mode if sparse key is not found @raw_data.keys.include?(key) end