|
I was creating a windows provider that consumed a ini file. I decided that I would use the Puppet::Util::IniConfig::PhysicalFile to parse my ini file however it seems one of the regex values is not able to parse my content.
-
regex that has trouble with my ini content
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/inifile.rb#L151
The content that breaks this is found here and I have highlighted the line where it breaks: https://gist.github.com/logicminds/1d4bea2d5ac0285e3417#file-gistfile1-txt-L34
At a glance I think just using the split function to capture the right and left side of the equal sign would work, but I am sure its more complicated than that as I don't have any other inclination of what goes into an ini file.
My provider code does something like this for reference and was hoping to utilize the work of the utility rather than reinventing the wheel.
inffile = 'c:\\windows\\temp secedit.inf' secedit(['/export', '/cfg', inffile, '/quiet']) inf = Puppet::Util::IniConfig::PhysicalFile.new(inffile).read
So the regex can't handle the awesomeness of windows files and I assume this affects all versions of puppet.
|