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

Instance Method Details

#fetch_license_keys_from_fileObject



88
89
90
91
92
93
94
# File 'lib/chef-licensing/context.rb', line 88

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



84
85
86
# File 'lib/chef-licensing/context.rb', line 84

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