Class: ChefLicensing::LicensingService::Local
- Inherits:
-
Object
- Object
- ChefLicensing::LicensingService::Local
- Defined in:
- lib/chef-licensing/licensing_service/local.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
8 9 10 |
# File 'lib/chef-licensing/licensing_service/local.rb', line 8 def logger @logger end |
Class Method Details
.detected? ⇒ Boolean
11 12 13 |
# File 'lib/chef-licensing/licensing_service/local.rb', line 11 def detected? new.detected? end |
Instance Method Details
#detected? ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/chef-licensing/licensing_service/local.rb', line 16 def detected? return ChefLicensing::Config.is_local_license_service if ChefLicensing::Config.is_local_license_service ChefLicensing::Api::ListLicenses.info true rescue ChefLicensing::ListLicensesError => e # If API call returns 404, it is a global licensing service return false if e.status_code == 404 raise(ChefLicensing::ListLicensesError.new("Error occured while fetching licenses #{e.}", e.status_code)) end |