Class: Puppet::Settings::AutosignSetting Private
- Inherits:
-
FileSetting
- Object
- BaseSetting
- StringSetting
- FileSetting
- Puppet::Settings::AutosignSetting
- Defined in:
- lib/puppet/settings/autosign_setting.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A specialization of the file setting to allow boolean values.
The autosign value can be either a boolean or a file path, and if the setting is a file path then it may have a owner/group/mode specified.
Instance Attribute Summary
Attributes inherited from FileSetting
Attributes inherited from BaseSetting
#call_hook, #default, #deprecated, #desc, #name, #section, #short
Instance Method Summary collapse
- #munge(value) ⇒ Object private
Methods inherited from FileSetting
#create_files?, #exclusive_open, #group, #group=, #initialize, #open, #owner, #owner=, #set_meta, #to_resource, #type, #validate
Methods inherited from StringSetting
Methods inherited from BaseSetting
#allowed_on_commandline?, available_call_hook_values, #call_hook_on_define?, #call_hook_on_initialize?, #completely_deprecated?, #deprecated?, #getopt_args, #has_hook?, #hook=, #initialize, #inspect, #iscreated, #iscreated?, #optparse_args, #set_meta, #to_config, #value
Constructor Details
This class inherits a constructor from Puppet::Settings::FileSetting
Instance Method Details
#munge(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/puppet/settings/autosign_setting.rb', line 11 def munge(value) if ['true', true].include? value true elsif ['false', false, nil].include? value false elsif Puppet::Util.absolute_path?(value) value else raise Puppet::Settings::ValidationError, _("Invalid autosign value %{value}: must be 'true'/'false' or an absolute path") % { value: value } end end |