Module: R10K::Util::License

Extended by:
Logging
Defined in:
lib/r10k/util/license.rb

Constant Summary

Constants included from Logging

Logging::LOG_LEVELS, Logging::SYSLOG_LEVELS_MAP

Class Method Summary collapse

Methods included from Logging

add_outputters, debug_formatter, default_formatter, default_outputter, logger, logger_name, parse_level

Class Method Details

.loadObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/r10k/util/license.rb', line 9

def self.load
  if R10K::Features.available?(:pe_license)
    logger.debug2 _("pe_license feature is available, loading PE license key")
    begin
      return PELicense.load_license_key
    rescue PELicense::InvalidLicenseError => e
      raise R10K::Error.wrap(e, _("Invalid PE license detected: %{error_msg}") % {error_msg: e.message} )
    end
  else
    logger.debug2 _("pe_license feature is not available, PE only Puppet modules will not be downloadable.")
    nil
  end
end