summaryrefslogtreecommitdiff
path: root/lib/chef/knife/config_use_profile.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-02-06 17:21:55 -0800
committerGitHub <noreply@github.com>2020-02-06 17:21:55 -0800
commit37b22e0524d4aac76e4dcead98bf6778079b58ca (patch)
tree6166033be83f399ef4289ac574f84748e09789aa /lib/chef/knife/config_use_profile.rb
parentd923776da3a886c61ac6360bd968a3bc82dbb68f (diff)
parent8ab22a0878761e51a7d2c74d2cd0eb289e9affb6 (diff)
downloadchef-37b22e0524d4aac76e4dcead98bf6778079b58ca.tar.gz
Merge pull request #9351 from chef/knife_15
Lazy load as many knife deps as possible
Diffstat (limited to 'lib/chef/knife/config_use_profile.rb')
-rw-r--r--lib/chef/knife/config_use_profile.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/knife/config_use_profile.rb b/lib/chef/knife/config_use_profile.rb
index 89d75b3369..134ae5e8b6 100644
--- a/lib/chef/knife/config_use_profile.rb
+++ b/lib/chef/knife/config_use_profile.rb
@@ -15,8 +15,6 @@
# limitations under the License.
#
-require "fileutils" unless defined?(FileUtils)
-
require_relative "../knife"
class Chef
@@ -24,6 +22,10 @@ class Chef
class ConfigUseProfile < Knife
banner "knife config use-profile PROFILE"
+ deps do
+ require "fileutils" unless defined?(FileUtils)
+ end
+
# Disable normal config loading since this shouldn't fail if the profile
# doesn't exist of the config is otherwise corrupted.
def configure_chef