Skip to content

Commit

Permalink
Fix issue when xinetd.conf does not end in newline
Browse files Browse the repository at this point in the history
Add a newline symbol to the end of the parsed input.

Sample hexdump of a file deployed by xinetd cookbook:

$ hexdump -C /var/chef/cache/cookbooks/xinetd/templates/default/xinetd.conf.erb | tail -2
000000b0  72 20 2f 65 74 63 2f 78  69 6e 65 74 64 2e 64     |r /etc/xinetd.d|
000000bf
  • Loading branch information
kareiva committed Aug 1, 2017
1 parent 4ae3492 commit e6f9017
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/parser.rb
Expand Up @@ -211,7 +211,7 @@ def parse_xinetd(raw) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticCompl
res = {}
cur_group = nil
simple_conf = []
rest = raw
rest = raw + "\n"
until rest.empty?
# extract content line
nl = rest.index("\n") || (rest.length-1)
Expand Down

0 comments on commit e6f9017

Please sign in to comment.