Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_config_file fails when it encounters a '[' #687

Closed
nathenharvey opened this issue Apr 27, 2016 · 3 comments · Fixed by #1185
Closed

parse_config_file fails when it encounters a '[' #687

nathenharvey opened this issue Apr 27, 2016 · 3 comments · Fixed by #1185
Labels
Type: Bug Feature not working as expected
Milestone

Comments

@nathenharvey
Copy link
Contributor

Description

The parse_config_file resource seems unable to handle lines that start with [

InSpec and Platform Version

0.19.3 on Mac OSX 10.11.4

Replication Case

Given this yum.conf and this InSpec test, the check fails with this output.

Possible Solutions

You can work around this by setting '[' as the comment character as shown in this updated InSpec check

@eyespies
Copy link

eyespies commented Sep 1, 2016

+1 on this

@chris-rock chris-rock added the Type: Bug Feature not working as expected label Sep 21, 2016
@chris-rock chris-rock added this to the 1.1.0 milestone Sep 21, 2016
@vjeffrey vjeffrey self-assigned this Sep 26, 2016
@vjeffrey
Copy link

  describe parse_config_file('../yum.conf') do
    its('main') { should include('gpgcheck' => '1') }
  end

in our attempt to track down this bug, we found that the file is being parsed correctly, but gpgcheck is part of the hash under 'main'. A syntax like the above works...
What are people's thoughts?
Is that an ok syntax that just needs to be documented, or should we be doing something more/more specific for the yum.conf?

@vjeffrey
Copy link

Need to document this example in the resources docs for parse_config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants