Jira (PUP-10321) Resource 'notify': Attribute 'message' accepts Array but only use the first element
Title: Message Title Frédéric Lespez commented on PUP-10321 Re: Resource 'notify': Attribute 'message' accepts Array but only use the first element Ticket PUP-10346 opened to improve the documentation. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.348009.1582967531000.2814.1583260260050%40Atlassian.JIRA.
Jira (PUP-10321) Resource 'notify': Attribute 'message' accepts Array but only use the first element
Title: Message Title Frédéric Lespez commented on PUP-10321 Re: Resource 'notify': Attribute 'message' accepts Array but only use the first element I will open a ticket to update the docs. For the record, I discovered this when I was debugging a manifest. I lost a lot of time figuring out it was notify that was mangling the data. At the beginning, I wasn't even expecting the 'message' attributes to accept hashes, but it does and it handles them 'logically'. So in the end, I assumed it was also the case for arrays... My bad. Allowing notify to do the string conversion may not be the solution but doing nothing is endorsing weird behavior. Why not changing the 'message' attributes so that it only accepts strings ? At least, notify behavior will be coherent with predicable results. Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.348009.1582967531000.2613.1583255520028%40Atlassian.JIRA.
Jira (PUP-10321) Resource 'notify': Attribute 'message' accepts Array but only use the first element
Title: Message Title Henrik Lindberg commented on PUP-10321 Re: Resource 'notify': Attribute 'message' accepts Array but only use the first element That indeed looks like a bug. OTOH - allowing notify to do the string conversion means you have no control over how the resulting string is formatted. It is recommended to turn values into a string before assigning it to the message attribute. Depending on how much control you want - use one of: "${theArray}" $theArray.join(" ,") String($theArray) - with lots of options Add Comment This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-bugs/JIRA.348009.1582967531000.797.1582977240036%40Atlassian.JIRA.
Jira (PUP-10321) Resource 'notify': Attribute 'message' accepts Array but only use the first element
Title: Message Title Frédéric Lespez created an issue Puppet / PUP-10321 Resource 'notify': Attribute 'message' accepts Array but only use the first element Issue Type: Bug Assignee: Unassigned Created: 2020/02/29 1:12 AM Priority: Normal Reporter: Frédéric Lespez Puppet Version: 6.13.0 Puppet Server Version: 6.9.0 OS Name/Version: Debian 10 (Buster) Consider the following code: class test_notify { $a = ['a', 'b', 'c'] $b = {'a' => 1, 'b' => 2, 'c' => 3 } notify { 'Array': message => $a, ;