Page MenuHomeSoftware Heritage

No OneTemporary

diff --git a/.fixtures.yml b/.fixtures.yml
index 2d1290c..db98538 100644
--- a/.fixtures.yml
+++ b/.fixtures.yml
@@ -1,7 +1,3 @@
fixtures:
- repositories:
- stdlib:
- repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
- ref: '4.2.0'
symlinks:
inifile: "#{source_dir}"
diff --git a/manifests/init.pp b/manifests/init.pp
deleted file mode 100644
index 3590216..0000000
--- a/manifests/init.pp
+++ /dev/null
@@ -1,46 +0,0 @@
-# == Class: inifile
-#
-# Use create_resources() to allow the specification of ini_setting and
-# ini_subsetting entries.
-#
-class inifile (
- $ini_settings = undef,
- $ini_subsettings = undef,
- $ini_settings_hiera_merge = true,
- $ini_subsettings_hiera_merge = true,
-) {
-
- if is_string($ini_settings_hiera_merge) == true {
- $ini_settings_hiera_merge_bool = str2bool($ini_settings_hiera_merge)
- } else {
- $ini_settings_hiera_merge_bool = $ini_settings_hiera_merge
- }
- validate_bool($ini_settings_hiera_merge_bool)
-
- if is_string($ini_subsettings_hiera_merge) == true {
- $ini_subsettings_hiera_merge_bool = str2bool($ini_subsettings_hiera_merge)
- } else {
- $ini_subsettings_hiera_merge_bool = $ini_subsettings_hiera_merge
- }
- validate_bool($ini_subsettings_hiera_merge_bool)
-
- if $ini_settings != undef {
- if $ini_settings_hiera_merge_bool == true {
- $ini_settings_real = hiera_hash('inifile::ini_settings')
- } else {
- $ini_settings_real = $ini_settings
- }
- validate_hash($ini_settings_real)
- create_resources('ini_setting',$ini_settings_real)
- }
-
- if $ini_subsettings != undef {
- if $ini_subsettings_hiera_merge_bool == true {
- $ini_subsettings_real = hiera_hash('inifile::ini_subsettings')
- } else {
- $ini_subsettings_real = $ini_subsettings
- }
- validate_hash($ini_subsettings_real)
- create_resources('ini_subsetting',$ini_subsettings_real)
- }
-}
diff --git a/metadata.json b/metadata.json
index f14fd57..200673e 100644
--- a/metadata.json
+++ b/metadata.json
@@ -1,107 +1,106 @@
{
"name": "puppetlabs-inifile",
"version": "1.5.0",
"author": "Puppet Labs",
"summary": "Resource types for managing settings in INI files",
"license": "Apache-2.0",
"source": "https://github.com/puppetlabs/puppetlabs-inifile",
"project_page": "https://github.com/puppetlabs/puppetlabs-inifile",
"issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
"dependencies": [
- {"name":"puppetlabs/stdlib","version_requirement":">= 4.2.0 < 5.0.0"}
],
"data_provider": null,
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"10 SP4",
"11 SP1",
"12"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"6",
"7",
"8"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"10.04",
"12.04",
"14.04"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"10",
"11",
"12"
]
},
{
"operatingsystem": "Windows",
"operatingsystemrelease": [
"Server 2003 R2",
"Server 2008 R2",
"Server 2012",
"Server 2012 R2"
]
},
{
"operatingsystem": "AIX",
"operatingsystemrelease": [
"5.3",
"6.1",
"7.1"
]
}
],
"requirements": [
{
"name": "pe",
"version_requirement": ">= 3.0.0"
},
{
"name": "puppet",
"version_requirement": ">= 3.0.0 < 5.0.0"
}
]
}
diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb
deleted file mode 100644
index 14faf53..0000000
--- a/spec/classes/init_spec.rb
+++ /dev/null
@@ -1,166 +0,0 @@
-require 'spec_helper'
-describe 'inifile' do
-
- describe 'with default options' do
- it { should compile.with_all_deps }
- it { should contain_class('inifile') }
- end
-
- describe 'with parameter ini_settings_hiera_merge' do
- context 'set to an invalid type (non-string and a non-boolean)' do
- let(:params) { { :ini_settings_hiera_merge => ['invalid','type'] } }
-
- it 'should fail' do
- expect {
- should contain_class('inifile')
- }.to raise_error(Puppet::Error,/\["invalid", "type"\] is not a boolean./)
- end
- end
-
- ['true',true,'false',false].each do |value|
- context "set to #{value}" do
- let(:params) { { :ini_settings_hiera_merge => value } }
-
- it { should contain_class('inifile') }
- end
- end
- end
-
- describe 'with parameter ini_settings' do
- context 'set to an invalid type (non-hash)' do
- let(:params) do
- {
- :ini_settings => ['invalid','type'],
- :ini_settings_hiera_merge => false,
- }
- end
-
- it 'should fail' do
- expect {
- should contain_class('inifile')
- }.to raise_error(Puppet::Error,/\["invalid", "type"\] is not a Hash./)
- end
- end
-
- context 'set to a valid hash' do
- let(:params) { { :ini_settings_hiera_merge => false,
- :ini_settings => {
- 'sample setting' => {
- 'ensure' => 'absent',
- 'path' => '/tmp/foo.ini',
- 'section' => 'foo',
- 'setting' => 'foosetting',
- 'value' => 'FOO!',
- },
- 'colorize_git' => {
- 'ensure' => 'present',
- 'path' => '/root/.gitconfig',
- 'section' => 'color',
- 'setting' => 'ui',
- 'value' => 'auto',
- }
- } } }
-
- it { should contain_class('inifile') }
-
- it {
- should contain_ini_setting('sample setting').with({
- 'ensure' => 'absent',
- 'path' => '/tmp/foo.ini',
- 'section' => 'foo',
- 'setting' => 'foosetting',
- 'value' => 'FOO!',
- })
- }
-
- it {
- should contain_ini_setting('colorize_git').with({
- 'ensure' => 'present',
- 'path' => '/root/.gitconfig',
- 'section' => 'color',
- 'setting' => 'ui',
- 'value' => 'auto',
- })
- }
- end
- end
-
- describe 'with parameter ini_subsettings_hiera_merge' do
- context 'set to an invalid type (non-string and a non-boolean)' do
- let(:params) { { :ini_subsettings_hiera_merge => ['invalid','type'] } }
-
- it 'should fail' do
- expect {
- should contain_class('inifile')
- }.to raise_error(Puppet::Error,/\["invalid", "type"\] is not a boolean./)
- end
- end
-
- ['true',true,'false',false].each do |value|
- context "set to #{value}" do
- let(:params) { { :ini_subsettings_hiera_merge => value } }
-
- it { should contain_class('inifile') }
- end
- end
- end
-
- describe 'with parameter ini_subsettings' do
- context 'set to an invalid type (non-hash)' do
- let(:params) do
- {
- :ini_subsettings => ['invalid','type'],
- :ini_subsettings_hiera_merge => false,
- }
- end
-
- it 'should fail' do
- expect {
- should contain_class('inifile')
- }.to raise_error(Puppet::Error,/\["invalid", "type"\] is not a Hash./)
- end
- end
-
- context 'set to a valid hash' do
- let(:params) { { :ini_subsettings_hiera_merge => false,
- :ini_subsettings => {
- 'sample setting' => {
- 'ensure' => 'absent',
- 'path' => '/tmp/foo.ini',
- 'section' => 'foo',
- 'setting' => 'foosetting',
- 'value' => 'FOO!',
- },
- 'colorize_git' => {
- 'ensure' => 'present',
- 'path' => '/root/.gitconfig',
- 'section' => 'color',
- 'setting' => 'ui',
- 'value' => 'auto',
- }
- } } }
-
- it { should contain_class('inifile') }
-
- it {
- should contain_ini_subsetting('sample setting').with({
- 'ensure' => 'absent',
- 'path' => '/tmp/foo.ini',
- 'section' => 'foo',
- 'setting' => 'foosetting',
- 'value' => 'FOO!',
- })
- }
-
- it {
- should contain_ini_subsetting('colorize_git').with({
- 'ensure' => 'present',
- 'path' => '/root/.gitconfig',
- 'section' => 'color',
- 'setting' => 'ui',
- 'value' => 'auto',
- })
- }
- end
- end
-end

File Metadata

Mime Type
text/x-diff
Expires
Thu, Sep 18, 4:48 PM (1 d, 3 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3313476

Event Timeline