Skip to content

Commit

Permalink
Merge pull request #82 from igalic/indent
Browse files Browse the repository at this point in the history
indent sub-entries to the in interfaces
  • Loading branch information
adrienthebo committed Sep 13, 2014
2 parents 98a0275 + cd90e8e commit 9875503
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/network_config/interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ def self.format_file(filename, providers)
if provider.options
provider.options.each_pair do |key, val|
if val.is_a? String
stanza << "#{key} #{val}"
stanza << " #{key} #{val}"
elsif val.is_a? Array
val.each { |entry| stanza << "#{key} #{entry}" }
val.each { |entry| stanza << " #{key} #{entry}" }
else
raise Puppet::Error, "#{self} options key #{key} expects a String or Array, got #{val.class}"
end
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/provider/network_config/interfaces_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def fixture_data(file)
end

it "should write the value as an modified string" do
content.scan(/^pre-up .*$/).first.should == "pre-up /bin/touch /tmp/eth1-up"
content.scan(/^\s*pre-up .*$/).first.should == " pre-up /bin/touch /tmp/eth1-up"
end
end

Expand All @@ -247,8 +247,8 @@ def fixture_data(file)
end

it "should write the values in order" do
content.scan(/^post-down .*$/)[0].should == "post-down /bin/touch /tmp/eth1-down1"
content.scan(/^post-down .*$/)[1].should == "post-down /bin/touch /tmp/eth1-down2"
content.scan(/^\s*post-down .*$/)[0].should == " post-down /bin/touch /tmp/eth1-down1"
content.scan(/^\s*post-down .*$/)[1].should == " post-down /bin/touch /tmp/eth1-down2"
end
end
end
Expand Down

0 comments on commit 9875503

Please sign in to comment.