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

file type content can't convert Fixnum into String

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: PUP 3.4.3
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:

      Description

      Setting the content of a file type to a numeric, using a value derived from another fails, as in this example:

      class test_numeric ($test=100) {
        # This works
        file {"/tmp/test":
          content => $test,
        }
       
        $test2 = $test + 1
        #  This fails:
        file {"/tmp/test2":
          content => $test2,
        }
      }
      

      The error given is:

      Munging failed for value 101 in class content: can't convert Fixnum into String

      A work around is to quote wrap the variable, but this breaks the style guide, makes puppet-lint grizzle and is inconsistent, as other types, such as notify, have no problem with this.

        Attachments

          Activity

            People

            Assignee:
            kylo Kylo Ginsberg
            Reporter:
            jwm John Morton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support