Skip to content

Commit

Permalink
iptables: strip lines if iptables -S output
Browse files Browse the repository at this point in the history
As it turns out, some of the lines on CentOS 6 had a trailing space in it.

Fixes #420.
  • Loading branch information
srenatus committed Feb 10, 2016
1 parent 726dbc6 commit 8578277
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resources/iptables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def retrieve_rules
return [] if cmd.exit_status.to_i != 0

# split rules, returns array or rules
@iptables_cache = cmd.stdout.chomp.split("\n")
@iptables_cache = cmd.stdout.split("\n").map(&:strip)
end

def to_s
Expand Down

0 comments on commit 8578277

Please sign in to comment.