summaryrefslogtreecommitdiff
path: root/lib/puppet/util
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/util')
-rw-r--r--lib/puppet/util/ini_file.rb8
-rw-r--r--lib/puppet/util/ini_file/section.rb4
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/puppet/util/ini_file.rb b/lib/puppet/util/ini_file.rb
index 90b0c7b..48600ea 100644
--- a/lib/puppet/util/ini_file.rb
+++ b/lib/puppet/util/ini_file.rb
@@ -23,6 +23,14 @@ module Util
@section_names
end
+ def get_settings(section_name)
+ section = @sections_hash[section_name]
+ section.setting_names.inject({}) do |result, setting|
+ result[setting] = section.get_value(setting)
+ result
+ end
+ end
+
def get_value(section_name, setting)
if (@sections_hash.has_key?(section_name))
@sections_hash[section_name].get_value(setting)
diff --git a/lib/puppet/util/ini_file/section.rb b/lib/puppet/util/ini_file/section.rb
index ba1a783..9682d7f 100644
--- a/lib/puppet/util/ini_file/section.rb
+++ b/lib/puppet/util/ini_file/section.rb
@@ -32,6 +32,10 @@ class IniFile
@end_line.nil?
end
+ def setting_names
+ @existing_settings.keys | @additional_settings.keys
+ end
+
def get_value(setting_name)
@existing_settings[setting_name] || @additional_settings[setting_name]
end