mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
CHEF-3895: Prevent Stacktrace in STDOUT by handling Invalid License exception during license add
(#77)
* FIX: Handle invalid license exception as handled in base_cli:57 Signed-off-by: Sonu Saha <sonu.saha@progress.com> * Use 174 error code when exiting with license subsystem error from license add Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> --------- Signed-off-by: Sonu Saha <sonu.saha@progress.com> Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com> Co-authored-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
c4ba48b36f
commit
50aabd06d3
1 changed files with 4 additions and 1 deletions
|
@ -14,7 +14,10 @@ module InspecPlugins::License
|
|||
ChefLicensing.add_license
|
||||
rescue ChefLicensing::LicenseKeyFetcher::LicenseKeyAddNotAllowed => e
|
||||
Inspec::Log.error e.message
|
||||
Inspec::UI::EXIT_LICENSE_NOT_SET
|
||||
Inspec::UI.new.exit(Inspec::UI::EXIT_LICENSE_NOT_SET)
|
||||
rescue ChefLicensing::Error => e
|
||||
Inspec::Log.error e.message
|
||||
Inspec::UI.new.exit(Inspec::UI::EXIT_LICENSE_NOT_SET)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue