Class: InspecPlugins::License::CLI

Inherits:
Object
  • Object
show all
Includes:
Inspec::Dist
Defined in:
lib/plugins/inspec-license/lib/inspec-license/cli.rb

Constant Summary

Constants included from Inspec::Dist

Inspec::Dist::AUTOMATE_PRODUCT_NAME, Inspec::Dist::COMPLIANCE_PRODUCT_NAME, Inspec::Dist::EXEC_NAME, Inspec::Dist::PRODUCT_NAME, Inspec::Dist::SERVER_PRODUCT_NAME

Instance Method Summary collapse

Instance Method Details

#addObject



16
17
18
19
20
21
22
23
24
# File 'lib/plugins/inspec-license/lib/inspec-license/cli.rb', line 16

def add
  ChefLicensing.add_license
rescue ChefLicensing::LicenseKeyFetcher::LicenseKeyAddNotAllowed => e
  Inspec::Log.error e.message
  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

#listObject



8
9
10
11
12
13
# File 'lib/plugins/inspec-license/lib/inspec-license/cli.rb', line 8

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