Class: ChefLicensing::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/chef-licensing/config.rb

Class Attribute Summary collapse

Class Attribute Details

.chef_entitlement_idObject

is_local_license_service is used by context class



19
20
21
# File 'lib/chef-licensing/config.rb', line 19

def chef_entitlement_id
  @chef_entitlement_id
end

.chef_executable_nameObject

is_local_license_service is used by context class



19
20
21
# File 'lib/chef-licensing/config.rb', line 19

def chef_executable_name
  @chef_executable_name
end

.chef_product_nameObject

is_local_license_service is used by context class



19
20
21
# File 'lib/chef-licensing/config.rb', line 19

def chef_product_name
  @chef_product_name
end

.is_local_license_serviceObject

is_local_license_service is used by context class



19
20
21
# File 'lib/chef-licensing/config.rb', line 19

def is_local_license_service
  @is_local_license_service
end

.license_add_commandObject



43
44
45
# File 'lib/chef-licensing/config.rb', line 43

def license_add_command
  @license_add_command ||= "license add"
end

.license_list_commandObject



47
48
49
# File 'lib/chef-licensing/config.rb', line 47

def license_list_command
  @license_list_command ||= "license list"
end

.license_server_url(opts = {}) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/chef-licensing/config.rb', line 21

def license_server_url(opts = {})
  return @license_server_url if @license_server_url && @license_server_url_check_in_file

  license_server_url_from_system = ChefLicensing::ArgFetcher.fetch_value("--chef-license-server", :string) || ChefLicensing::EnvFetcher.fetch_value("CHEF_LICENSE_SERVER", :string)

  @license_server_url = ChefLicensing::LicenseKeyFetcher::File.fetch_or_persist_url(@license_server_url, license_server_url_from_system, opts)
  @license_server_url_check_in_file = true
  @license_server_url
end

.license_server_url_check_in_file=(value) ⇒ Object (writeonly)

Sets the attribute license_server_url_check_in_file

Parameters:

  • value

    the value to set the attribute license_server_url_check_in_file to.



16
17
18
# File 'lib/chef-licensing/config.rb', line 16

def license_server_url_check_in_file=(value)
  @license_server_url_check_in_file = value
end

.loggerObject



31
32
33
34
35
36
37
# File 'lib/chef-licensing/config.rb', line 31

def logger
  return @logger if @logger

  @logger = Logger.new(STDERR)
  @logger.level = Logger::INFO
  @logger
end

.outputObject



39
40
41
# File 'lib/chef-licensing/config.rb', line 39

def output
  @output ||= STDOUT
end