The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #13530

file_line should default to ensure => present

Added by Eric Shamow about 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:03/29/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:type
Target version:stdlib 2.3.2
Keywords:file_line Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

The default appears to leave it undefined. That’s unexpected behavior – most resources default to some variety of present.

History

#1 Updated by Eric Shamow about 2 years ago

Demonstration:

root@pe-debian6:~# cat /opt/puppet/share/puppet/modules/stdlib/tests/file_line.pp# This is a simple smoke test
# of the file_line resource type.
file { '/tmp/dansfile':
ensure => present
}->
file_line { 'dans_line':
line => 'dan is awesome',
path => '/tmp/dansfile',
}
root@pe-debian6:~# puppet apply --verbose /opt/puppet/share/puppet/modules/stdlib/tests/file_line.pp
info: Loading facts in /opt/puppet/share/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in /opt/puppet/share/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /opt/puppet/share/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
info: Applying configuration version '1333070398'
notice: /Stage[main]//File[/tmp/dansfile]/ensure: created
notice: Finished catalog run in 0.04 seconds
root@pe-debian6:~# cat /opt/puppet/share/puppet/modules/stdlib/tests/file_line_copy.pp # This is a simple smoke test
# of the file_line resource type.
file { '/tmp/dansfile':
ensure => present
}->
file_line { 'dans_line':
ensure => present,
line   => 'dan is awesome',
path   => '/tmp/dansfile',
}
root@pe-debian6:~# puppet apply --verbose /opt/puppet/share/puppet/modules/stdlib/tests/file_line_copy.pp 
info: Loading facts in /opt/puppet/share/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in /opt/puppet/share/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /opt/puppet/share/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/facter_dot_d.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/root_home.rb
info: Loading facts in /var/opt/lib/pe-puppet/lib/facter/puppet_vardir.rb
info: Applying configuration version '1333070415'
notice: /Stage[main]//File_line[dans_line]/ensure: created
notice: Finished catalog run in 0.04 seconds

#2 Updated by Ken Barber about 2 years ago

  • Project changed from Puppet Labs Modules to Standard Library
  • Category deleted (stdlib)
  • Status changed from Unreviewed to Accepted

Eric – stdlib project has now moved from modules to its own project I believe.

#3 Updated by Ken Barber about 2 years ago

  • Category set to type
  • Keywords set to file_line

#4 Updated by Eric Shamow about 2 years ago

Yep. I went and looked at the right one and proceeded to slowly and deliberately…….open the ticket in the wrong place.

Thanks Ken.

#5 Updated by Eric Shamow about 2 years ago

An update on this —

I’ve confirmed that the following pull request appears to cause the regression:

https://github.com/puppetlabs/puppetlabs-stdlib/pull/36

Which is in the following commit:

https://github.com/duritong/puppet-stdlib/commit/fc5cfc8cca2d9650d0b7e1dcafe92bf69aedadf9

Based on the comments in the pull request, Dan was correct in his questioning whether or not the default of ensure => present was undone by the commit.

#6 Updated by Peter Meier about 2 years ago

Pull request to fix the regression https://github.com/puppetlabs/puppetlabs-stdlib/pull/65

#7 Updated by Jeff McCune almost 2 years ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Target version set to stdlib 2.3.x

#8 Updated by Jeff McCune almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Closed
  • Target version changed from stdlib 2.3.x to stdlib 2.3.2

Also available in: Atom PDF