Skip to content

Commit 70c7fb2

Browse files
committed
Merge pull request #157 from hunner/mrzarquon-MODULES_1868_add_default
Adds default values for section
2 parents 57c68ba + af78845 commit 70c7fb2

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

README.markdown

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ ini_setting { "sample setting":
4343

4444
The inifile module tries hard not to manipulate your file any more than it needs to. In most cases, it doesn't affect the original whitespace, comments, ordering, etc.
4545

46-
4746
* Supports comments starting with either '#' or ';'.
4847
* Supports either whitespace or no whitespace around '='.
4948
* Adds any missing sections to the INI file.
@@ -171,7 +170,7 @@ Determines whether the specified setting should exist. Valid options: 'present'
171170

172171
##### `setting`
173172

174-
*Required.* Designates a setting to manage within the specified INI file and section. Valid options: a string.
173+
*Optional.* Designates a section of the specified INI file containing the setting to manage. To manage a global setting (at the beginning of the file, before any named sections) enter "". Defaults to "". Valid options: a string.
175174

176175
##### `value`
177176

@@ -202,7 +201,7 @@ Specifies whether the subsetting should be present. Valid options: 'present' and
202201

203202
##### `section`
204203

205-
*Required.* Designates a section of the specified INI file containing the subsetting to manage. To manage a global setting (at the beginning of the file, before any named sections) enter "". Valid options: a string, or "".
204+
*Optional.* Designates a section of the specified INI file containing the setting to manage. To manage a global setting (at the beginning of the file, before any named sections) enter "". Defaults to "". Valid options: a string.
206205

207206
##### `setting`
208207

@@ -237,4 +236,4 @@ For more information, see our [module contribution guide.](https://docs.puppetla
237236

238237
###Contributors
239238

240-
To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-inifile/graphs/contributors)
239+
To see who's already involved, see the [list of contributors.](https://github.com/puppetlabs/puppetlabs-inifile/graphs/contributors)

lib/puppet/type/ini_setting.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
end
1111

1212
newparam(:section) do
13-
desc 'The name of the section in the ini file in which the setting should be defined.'
13+
desc 'The name of the section in the ini file in which the setting should be defined.' +
14+
'If not provided, defaults to global, top of file, sections.'
15+
defaultto("")
1416
end
1517

1618
newparam(:setting) do

lib/puppet/type/ini_subsetting.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
end
1111

1212
newparam(:section) do
13-
desc 'The name of the section in the ini file in which the setting should be defined.'
13+
desc 'The name of the section in the ini file in which the setting should be defined.' +
14+
'If not provided, defaults to global, top of file, sections.'
15+
defaultto("")
1416
end
1517

1618
newparam(:setting) do

0 commit comments

Comments
 (0)