Jira (PUP-9365) Newlines in resource titles result in invalid .dot files

6 views
Skip to first unread message

Mihkel Ader (JIRA)

unread,
Dec 17, 2018, 7:50:03 AM12/17/18
to puppe...@googlegroups.com
Mihkel Ader created an issue
 
Puppet / Bug PUP-9365
Newlines in resource titles result in invalid .dot files
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2018/12/17 4:49 AM
Priority: Trivial Trivial
Reporter: Mihkel Ader

Puppet Version: 6.0.4
Puppet Server Version:
OS Name/Version: Linux

Puppet does not escape newlines in resource titles when generating graph files:

 

# puppet apply --graph -e 'notify {"line1\nline2":}'
...
# dotty .puppetlabs/opt/puppet/cache/state/graphs/resources.dot
graph parser: string ran past end of line near line 18
context: >>> Notif <<< y[line1
line1
dotty.lefty: cannot load graph

Desired Behavior:

Newlines in generated node IDs and labels should be escaped with \

Actual Behavior:

Newlines are not escaped, .dot files have syntax errors

 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Eric Sorenson (JIRA)

unread,
Dec 17, 2018, 4:52:03 PM12/17/18
to puppe...@googlegroups.com
Eric Sorenson commented on Bug PUP-9365
 
Re: Newlines in resource titles result in invalid .dot files

Titles with newlines are kind of unspecified behaviour - what is the problem you are trying to solve here?

cc Henrik Lindberg - not sure if a title with embedded newline is even an acceptable syntax

Eric Sorenson (JIRA)

unread,
Dec 17, 2018, 4:53:03 PM12/17/18
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Dec 23, 2018, 9:24:02 AM12/23/18
to puppe...@googlegroups.com
Henrik Lindberg commented on Bug PUP-9365
 
Re: Newlines in resource titles result in invalid .dot files

The only real constraint is that a title must be unique for all instances of the resource type and that it should not contain square brackets - what happens if there is a newline in that string is indeed unspecified and I suspect that there are quite a few use cases where that could lead to surprising results.

Henrik Lindberg (JIRA)

unread,
Jan 3, 2019, 9:40:02 AM1/3/19
to puppe...@googlegroups.com

For anyone that want to work on this - I think the logic is here: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/graph/simple_graph.rb#L439
For some values it calls a stringify method, and it only deals with embedded double quotes. Not certain if something similar is needed for values that are used in DOT output without stringifying them.

Josh Cooper (JIRA)

unread,
Jun 19, 2019, 2:10:03 PM6/19/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Jun 19, 2019, 5:17:04 PM6/19/19
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Labels: beginner help_wanted

Josh Cooper (JIRA)

unread,
Oct 1, 2019, 1:05:03 AM10/1/19
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 14, 2021, 7:15:02 PM6/14/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-9365
 
Re: Newlines in resource titles result in invalid .dot files

This hasn't been updated in a few years and we don't have plans on fixing this anytime soon. If anyone wants to work on this, please reopen and ping us in slack if you have questions.

This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages