Jira (PUP-8343) When enforcing String data type for a class param, a regex data type does not raise an error.

0 views
Skip to first unread message

Sam Woods (JIRA)

unread,
Jan 11, 2018, 12:01:12 PM1/11/18
to puppe...@googlegroups.com
Sam Woods created an issue
 
Puppet / Bug PUP-8343
When enforcing String data type for a class param, a regex data type does not raise an error.
Issue Type: Bug Bug
Assignee: Unassigned
Components: Language
Created: 2018/01/11 9:00 AM
Priority: Normal Normal
Reporter: Sam Woods

When enforcing a String data type for a class parameter:

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

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

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

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Josh Cooper (JIRA)

unread,
Jan 12, 2018, 2:12:02 PM1/12/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jan 12, 2018, 2:12:03 PM1/12/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Jan 13, 2018, 5:18:03 AM1/13/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Jan 15, 2018, 11:20:02 AM1/15/18
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
When enforcing a String data type for a class parameter:

{code:
java puppet }
class test::myclass (

  String $my_string = 'default' ,
) { 
  notice   notify  { "notice ${my_string}" :  }
}
{code}


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

{code: java puppet }

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

Henrik Lindberg (JIRA)

unread,
Jan 15, 2018, 12:43:02 PM1/15/18
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Sub-team: Language
Release Notes Summary: 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.
Sprint: Platform Core KANBAN
Release Notes: Bug Fix

Henrik Lindberg (JIRA)

unread,
Jan 18, 2018, 5:24:03 AM1/18/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jan 23, 2018, 2:30:03 PM1/23/18
to puppe...@googlegroups.com

John Duarte (JIRA)

unread,
Oct 21, 2019, 10:51:03 AM10/21/19
to puppe...@googlegroups.com
John Duarte updated an issue
Change By: John Duarte
QA Risk Assessment: Needs Assessment No Action
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages