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

add ensure=absent support #17

Merged
merged 1 commit into from Oct 17, 2012
Merged

add ensure=absent support #17

merged 1 commit into from Oct 17, 2012

Conversation

bodepd
Copy link

@bodepd bodepd commented Oct 11, 2012

This commit adds the ability to ensure that lines are absent.

Chris, please double check this. I was a little confused by the fact that the file lines indices need to be updated and at first was seeing nils printed to the resulting file.

This commit adds the ability to ensure that lines are absent.
@cprice404
Copy link

@bodepd : just got back from vacation, will take a peek at this soon.

@bodepd
Copy link
Author

bodepd commented Oct 16, 2012

@cprice-puppet please have a close look. I was guessing a little bit at how it should be implemented.

@cprice404
Copy link

@bodepd : are you implying that I don't always do that? :) I really did review your last one before I merged it! It was legit.

I'll be careful on this one though, thanks for the heads up.

section = @sections_hash[name]

if section.start_line.nil?
fh.puts("\n[#{section.name}]")
elsif ! section.end_line.nil?
(section.start_line..section.end_line).each do |line_num|
fh.puts(lines[line_num])
if lines[line_num]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little iffy on this part. @bodepd : I may open a new pull with another commit on top of this one.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was printing an extra nil at the end of the line b/c the line numbers related to the sections were not being recalculated. which resulted in an extra newline. I was not sure if there was something that I should have been calling to recalculate the line numbers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as an FYI, the inifile based native types for openstack have gotten great reception this week!

@cprice404 cprice404 merged commit 1106d70 into puppetlabs:master Oct 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants