Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-3787

puppet resource file 'mode' parameter is 3-digit notation instead of 4-digit

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 3.7.3
    • PUP 4.0.0
    • Types and Providers
    • None
    • 1
    • Platform Client 2015-01-21

    Description

      Per https://docs.puppetlabs.com/references/latest/type.html#file-attribute-mode, numeric modes should use four-digit octal notation for files. However, the output of "puppet resource file <filename>" shows the mode in three-digit octal notation:

      [rnelson0@build ~]$ puppet apply -e "file {'/home/rnelson0/test': ensure => file, mode => '0644'}"
      Notice: Compiled catalog for build.nelson.va in environment production in 0.06 seconds
      Notice: /Stage[main]/Main/File[/home/rnelson0/test]/ensure: created
      Notice: Finished catalog run in 0.02 seconds
      [rnelson0@build ~]$ puppet resource file /home/rnelson0/test
      file { '/home/rnelson0/test':
        ensure  => 'file',
        content => '{md5}d41d8cd98f00b204e9800998ecf8427e',
        ctime   => '2014-12-22 18:02:28 +0000',
        group   => '501',
        mode    => '644',
        mtime   => '2014-12-22 18:02:28 +0000',
        owner   => '501',
        type    => 'file',
      }
      

      This makes it difficult to use puppet resource to discover and document existing files and preserve best practices for defining those resources. The 'mode' value should be four-digit octal notation as the documentation describes.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rnelson0@gmail.com Rob Nelson
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support