From 5145fbb779290adcd699b152509b7ca9be13aafa Mon Sep 17 00:00:00 2001 From: Sathish Babu <80091550+sathish-progress@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:57:44 +0530 Subject: [PATCH] CHEF-4010 make a clean exit for License list command (#6552) * make a clean exit for License list command Signed-off-by: Sathish * exit UI Signed-off-by: Sathish --------- Signed-off-by: Sathish --- lib/plugins/inspec-license/lib/inspec-license/cli.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/plugins/inspec-license/lib/inspec-license/cli.rb b/lib/plugins/inspec-license/lib/inspec-license/cli.rb index e7b0ec98b..e90312510 100644 --- a/lib/plugins/inspec-license/lib/inspec-license/cli.rb +++ b/lib/plugins/inspec-license/lib/inspec-license/cli.rb @@ -7,6 +7,9 @@ module InspecPlugins::License desc "list", "List licenses (not applicable to local licensing service)" def list ChefLicensing.list_license_keys_info + rescue ChefLicensing::Error => e + Inspec::Log.error e.message + Inspec::UI.new.exit(Inspec::UI::EXIT_LICENSE_NOT_SET) end desc "add", "Add a new license (not applicable to local licensing service)"