class Puppet::Settings::PrioritySetting

A setting that represents a scheduling priority, and evaluates to an OS-specific priority level.

Constants

PRIORITY_MAP

Public Instance Methods

munge(value) click to toggle source
# File lib/puppet/settings/priority_setting.rb, line 28
def munge(value)
  return unless value

  case
  when value.is_a?(Integer)
    value
  when (value.is_a?(String) and value =~ /\d+/)
    value.to_i
  when (value.is_a?(String) and PRIORITY_MAP[value.to_sym])
    PRIORITY_MAP[value.to_sym]
  else
    raise Puppet::Settings::ValidationError, "Invalid priority format '#{value.inspect}' for parameter: #{@name}"
  end
end
type() click to toggle source
# File lib/puppet/settings/priority_setting.rb, line 24
def type
  :priority
end