summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2017-12-15 15:52:15 +0000
committerThom May <thom@chef.io>2017-12-18 11:26:34 +0000
commit57732ab92cc315c6161fbdef4ee17ceaebffc656 (patch)
tree1b426b0cd5916098da2452b3706a11525bf46922 /lib/chef/knife.rb
parentd390c679654a92511f67e0a6fdebd211d5c84426 (diff)
downloadchef-57732ab92cc315c6161fbdef4ee17ceaebffc656.tar.gz
Specify a profile on the command line
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/knife.rb')
-rw-r--r--lib/chef/knife.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index aa30f2e2ed..1b9f165e21 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -178,8 +178,9 @@ class Chef
@config_loader ||= WorkstationConfigLoader.new(nil, Chef::Log)
end
- def self.load_config(explicit_config_file)
+ def self.load_config(explicit_config_file, profile)
config_loader.explicit_config_file = explicit_config_file
+ config_loader.profile = profile
config_loader.load
ui.warn("No knife configuration file found") if config_loader.no_config_found?
@@ -404,7 +405,7 @@ class Chef
def configure_chef
# knife needs to send logger output to STDERR by default
Chef::Config[:log_location] = STDERR
- config_loader = self.class.load_config(config[:config_file])
+ config_loader = self.class.load_config(config[:config_file], config[:profile])
config[:config_file] = config_loader.config_location
# For CLI options like `--config-option key=value`. These have to get