From 926517d92ec5c1ca823bb38c5ca68d9d4f67b6d8 Mon Sep 17 00:00:00 2001 From: snehaldwivedi Date: Wed, 20 Oct 2021 01:57:48 -0700 Subject: Moved changes form client.rb to base.rb Signed-off-by: snehaldwivedi --- lib/chef/application/base.rb | 8 +++++++- lib/chef/application/client.rb | 12 ------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/lib/chef/application/base.rb b/lib/chef/application/base.rb index fc8511a04b..7365ecadec 100644 --- a/lib/chef/application/base.rb +++ b/lib/chef/application/base.rb @@ -254,7 +254,13 @@ class Chef::Application::Base < Chef::Application short: "-K KEY_FILE", long: "--validation_key KEY_FILE", description: "Set the validation key file location, used for registering new clients.", - proc: nil + proc: lambda { |argument| + if File.exist?(File.expand_path(argument)) + File.expand_path(argument) + else + argument + end + } option :client_key, short: "-k KEY_FILE", diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index 9d8c7b6525..39ae7adaac 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -70,18 +70,6 @@ class Chef::Application::Client < Chef::Application::Base long: "--recipe-url=RECIPE_URL", description: "Pull down a remote archive of recipes and unpack it to the cookbook cache. Only used in local mode." - option :validation_key, - short: "-K KEY_FILE", - long: "--validation_key KEY_FILE", - description: "Set the validation key file location, used for registering new clients.", - proc: lambda { |argument| - if File.exist?(File.expand_path(argument)) - File.expand_path(argument) - else - argument - end - } - # Reconfigure the chef client # Re-open the JSON attributes and load them into the node def reconfigure -- cgit v1.2.1