summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Neitsch <andrew@neitsch.ca>2019-08-19 11:05:39 -0600
committerTim Smith <tsmith84@gmail.com>2019-10-09 10:44:28 -0700
commit54233b4253220be1fdd6068459c8e889b57bd4fc (patch)
treec26eb3b8b720b88d7bfaca87627500361248be06
parent81373edc4aa457915f644ae882405b6041843010 (diff)
downloadchef-54233b4253220be1fdd6068459c8e889b57bd4fc.tar.gz
Fix crash when showing error about missing profile
Before: /opt/chefdk/embedded/lib/ruby/gems/2.6.0/gems/chef-config-15.1.36/lib/chef-config/mixin/credentials.rb:92:in `load_credentials': undefined local variable or method `credentials_file' for #<ChefConfig::WorkstationConfigLoader:0x00007fe01c8321e8> (NameError) After: ERROR: CONFIGURATION ERROR:Profile xyz doesn't exist. Please add it to /Users/developer/.chef/credentials. It looks like this was missed as part of the refactoring in d730505bb0d53d14c7b005c756ed4993b95fdf94. Signed-off-by: Andrew Neitsch <andrew@neitsch.ca>
-rw-r--r--chef-config/lib/chef-config/mixin/credentials.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/chef-config/lib/chef-config/mixin/credentials.rb b/chef-config/lib/chef-config/mixin/credentials.rb
index 0a7ca356c8..3337294438 100644
--- a/chef-config/lib/chef-config/mixin/credentials.rb
+++ b/chef-config/lib/chef-config/mixin/credentials.rb
@@ -89,7 +89,8 @@ module ChefConfig
# Unknown profile name. For "default" just silently ignore, otherwise
# raise an error.
return if profile == "default"
- raise ChefConfig::ConfigurationError, "Profile #{profile} doesn't exist. Please add it to #{credentials_file}."
+
+ raise ChefConfig::ConfigurationError, "Profile #{profile} doesn't exist. Please add it to #{credentials_file_path}."
end
apply_credentials(config[profile], profile)
end