diff --git a/manifests/rule.pp b/manifests/rule.pp index 8a5eaa37..e9003ac2 100644 --- a/manifests/rule.pp +++ b/manifests/rule.pp @@ -178,8 +178,8 @@ case $compress { 'undef': {} - true: { $_compress = 'compress' } - false: { $_compress = 'nocompress' } + true: { $sane_compress = 'compress' } + false: { $sane_compress = 'nocompress' } default: { fail("Logrotate::Rule[${name}]: compress must be a boolean") } @@ -187,8 +187,8 @@ case $copy { 'undef': {} - true: { $_copy = 'copy' } - false: { $_copy = 'nocopy' } + true: { $sane_copy = 'copy' } + false: { $sane_copy = 'nocopy' } default: { fail("Logrotate::Rule[${name}]: copy must be a boolean") } @@ -196,8 +196,8 @@ case $copytruncate { 'undef': {} - true: { $_copytruncate = 'copytruncate' } - false: { $_copytruncate = 'nocopytruncate' } + true: { $sane_copytruncate = 'copytruncate' } + false: { $sane_copytruncate = 'nocopytruncate' } default: { fail("Logrotate::Rule[${name}]: copytruncate must be a boolean") } @@ -205,8 +205,8 @@ case $create { 'undef': {} - true: { $_create = 'create' } - false: { $_create = 'nocreate' } + true: { $sane_create = 'create' } + false: { $sane_create = 'nocreate' } default: { fail("Logrotate::Rule[${name}]: create must be a boolean") } @@ -214,8 +214,8 @@ case $delaycompress { 'undef': {} - true: { $_delaycompress = 'delaycompress' } - false: { $_delaycompress = 'nodelaycompress' } + true: { $sane_delaycompress = 'delaycompress' } + false: { $sane_delaycompress = 'nodelaycompress' } default: { fail("Logrotate::Rule[${name}]: delaycompress must be a boolean") } @@ -223,8 +223,8 @@ case $dateext { 'undef': {} - true: { $_dateext = 'dateext' } - false: { $_dateext = 'nodateext' } + true: { $sane_dateext = 'dateext' } + false: { $sane_dateext = 'nodateext' } default: { fail("Logrotate::Rule[${name}]: dateext must be a boolean") } @@ -232,16 +232,16 @@ case $mail { 'undef': {} - false: { $_mail = 'nomail' } + false: { $sane_mail = 'nomail' } default: { - $_mail = "mail ${mail}" + $sane_mail = "mail ${mail}" } } case $missingok { 'undef': {} - true: { $_missingok = 'missingok' } - false: { $_missingok = 'nomissingok' } + true: { $sane_missingok = 'missingok' } + false: { $sane_missingok = 'nomissingok' } default: { fail("Logrotate::Rule[${name}]: missingok must be a boolean") } @@ -249,16 +249,16 @@ case $olddir { 'undef': {} - false: { $_olddir = 'noolddir' } + false: { $sane_olddir = 'noolddir' } default: { - $_olddir = "olddir ${olddir}" + $sane_olddir = "olddir ${olddir}" } } case $sharedscripts { 'undef': {} - true: { $_sharedscripts = 'sharedscripts' } - false: { $_sharedscripts = 'nosharedscripts' } + true: { $sane_sharedscripts = 'sharedscripts' } + false: { $sane_sharedscripts = 'nosharedscripts' } default: { fail("Logrotate::Rule[${name}]: sharedscripts must be a boolean") } @@ -266,8 +266,8 @@ case $shred { 'undef': {} - true: { $_shred = 'shred' } - false: { $_shred = 'noshred' } + true: { $sane_shred = 'shred' } + false: { $sane_shred = 'noshred' } default: { fail("Logrotate::Rule[${name}]: shred must be a boolean") } @@ -275,8 +275,8 @@ case $ifempty { 'undef': {} - true: { $_ifempty = 'ifempty' } - false: { $_ifempty = 'notifempty' } + true: { $sane_ifempty = 'ifempty' } + false: { $sane_ifempty = 'notifempty' } default: { fail("Logrotate::Rule[${name}]: ifempty must be a boolean") } @@ -285,11 +285,11 @@ case $rotate_every { 'undef': {} 'hour', 'hourly': {} - 'day': { $_rotate_every = 'daily' } - 'week': { $_rotate_every = 'weekly' } - 'month': { $_rotate_every = 'monthly' } - 'year': { $_rotate_every = 'yearly' } - 'daily', 'weekly','monthly','yearly': { $_rotate_every = $rotate_every } + 'day': { $sane_rotate_every = 'daily' } + 'week': { $sane_rotate_every = 'weekly' } + 'month': { $sane_rotate_every = 'monthly' } + 'year': { $sane_rotate_every = 'yearly' } + 'daily', 'weekly','monthly','yearly': { $sane_rotate_every = $rotate_every } default: { fail("Logrotate::Rule[${name}]: invalid rotate_every value") } @@ -345,7 +345,7 @@ case $su { 'undef',false: {} - true: { $_su = 'su' } + true: { $sane_su = 'su' } default: { fail("Logrotate::Rule[${name}]: su must be a boolean") } @@ -358,7 +358,7 @@ fail("Logrotate::Rule[${name}]: Can't set both mailfirst and maillast") } - $_mailfirst = 'mailfirst' + $sane_mailfirst = 'mailfirst' } default: { fail("Logrotate::Rule[${name}]: mailfirst must be a boolean") @@ -368,7 +368,7 @@ case $maillast { 'undef',false: {} true: { - $_maillast = 'maillast' + $sane_maillast = 'maillast' } default: { fail("Logrotate::Rule[${name}]: maillast must be a boolean") diff --git a/templates/etc/logrotate.d/rule.erb b/templates/etc/logrotate.d/rule.erb index 4aa179e0..d6d9deba 100644 --- a/templates/etc/logrotate.d/rule.erb +++ b/templates/etc/logrotate.d/rule.erb @@ -10,30 +10,30 @@ rpath = @path end - if scope.to_hash.has_key?('_create') - if @_create == 'create' - opts << [@_create, @create_mode, @create_owner, @create_group].reject { |r| + if scope.to_hash.has_key?('sane_create') + if @sane_create == 'create' + opts << [@sane_create, @create_mode, @create_owner, @create_group].reject { |r| r == 'undef' }.join(' ') else - opts << @_create + opts << @sane_create end end - if scope.to_hash.has_key?('_su') - if @_su == 'su' - opts << [@_su, @su_owner, @su_group].reject { |r| + if scope.to_hash.has_key?('sane_su') + if @sane_su == 'su' + opts << [@sane_su, @su_owner, @su_group].reject { |r| r == 'undef' }.join(' ') end end [ - '_compress', '_copy', '_copytruncate', '_delaycompress', '_dateext', - '_mail', '_missingok', '_olddir', '_sharedscripts', '_ifempty', '_maillast', - '_mailfirst', '_shred', '_rotate_every' + 'compress', 'copy', 'copytruncate', 'delaycompress', 'dateext', + 'mail', 'missingok', 'olddir', 'sharedscripts', 'ifempty', 'maillast', + 'mailfirst', 'shred', 'rotate_every' ].each do |bool| - opts << scope.to_hash[bool] if scope.to_hash.has_key?(bool) + opts << scope.to_hash["sane_#{bool}"] if scope.to_hash.has_key?("sane_#{bool}") end [ diff --git a/vendor/cache/puppetlabs_spec_helper-0.4.1.gem b/vendor/cache/puppetlabs_spec_helper-0.4.1.gem deleted file mode 100644 index a82b0469..00000000 Binary files a/vendor/cache/puppetlabs_spec_helper-0.4.1.gem and /dev/null differ