Subject: | quotes_resource_ref_type single quotes values requiring interpolation |
Date: | Sun, 2 Jul 2017 17:57:08 +0000 |
To: | "bug-Puppet-Tidy [...] rt.cpan.org" <bug-Puppet-Tidy [...] rt.cpan.org> |
From: | Jay McCanta <J.McCanta [...] F5.com> |
Puppet::Tidy v 0.3
A resource like:
File {'/var/temp/grape':
requires => File["/var/tmp/$neehigh"]
}
Changes the requires line to:
requires => File['/var/tmp/$neehigh']
The changing of double quotes to single quotes breaks the interpolation.
This brute-force patch addresses this one issue. May cause others:
--- /usr/share/perl5/Puppet/Tidy.pm 2017-07-02 10:45:39.215376501 -0700
+++ /var/tmp/Tidy.pm 2017-07-02 10:46:05.051837387 -0700
@@ -200,7 +200,7 @@
my $type = $1;
next unless $line =~ m/$type\[\"/;
- $line =~ s/$type\["(.*?)"\]/$type\[\x27$1\x27\]/g;
+ $line =~ s/$type\["([^\$]*?)"\]/$type\[\x27$1\x27\]/g;
}
}
}
Jay McCanta | Principal Systems Administrator
F5 Networks, Inc.