Class: ChefLicensing::Context::Global

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

Instance Attribute Summary

Attributes inherited from State

#context, #options

Instance Method Summary collapse

Methods inherited from State

#license, #license=

Instance Method Details

#fetch_license_keys_from_fileObject



123
124
125
126
127
128
129
# File 'lib/chef-licensing/context.rb', line 123

def fetch_license_keys_from_file
  file_fetcher = LicenseKeyFetcher::File.new(options)
  if file_fetcher.persisted?
    # This could be useful if the file was writable in past but is not writable in current scenario and new keys are not persisted in the file
    file_fetcher.fetch
  end
end

#license_keysObject



119
120
121
# File 'lib/chef-licensing/context.rb', line 119

def license_keys
  @license_keys ||= fetch_license_keys_from_file || []
end