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

When enforcing String data type for a class param, a regex data type does not raise an error.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.4.0
    • Component/s: Language
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Sub-team:
    • Team:
      Platform Core
    • Sprint:
      Platform Core KANBAN
    • Method Found:
      Manual Test
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      When using "rich" data types with defined resource types, classes or functions, data types considered "rich" were converted to String form too early. Notably, a Regular Expression would be converted to a String. This was done to prevent "rich" data from ending up in the catalog - but that is now handled in a general way. The conversion is now dropped and defines, classes and 3x function will now get instances of Regexp, Version, VersionRange, Binary, Timespan, and Timestamp instead of a String representation of the value.
      Show
      When using "rich" data types with defined resource types, classes or functions, data types considered "rich" were converted to String form too early. Notably, a Regular Expression would be converted to a String. This was done to prevent "rich" data from ending up in the catalog - but that is now handled in a general way. The conversion is now dropped and defines, classes and 3x function will now get instances of Regexp, Version, VersionRange, Binary, Timespan, and Timestamp instead of a String representation of the value.
    • QA Risk Assessment:
      No Action

      Description

      When enforcing a String data type for a class parameter:

      class test::myclass(String $my_string = 'default') { 
        notify { "notice ${my_string}": }
      }
      

      If you provide a Regex data type, no exception is raised:

      class { 'test::myclass':
        my_string => /my_regex/
      }
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            sam.woods Sam Woods
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support