Skip to content

Commit 591e7b6

Browse files
committed
Lint
1 parent 4603809 commit 591e7b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/puppet/provider/network_config/interfaces.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def self.parse_file(_filename, contents)
245245
end
246246

247247
def self.interface_order(name, rules)
248-
(rules['rules'].map{ |entry| if name.match(entry.first) then entry.last end } + [rules['default']]).compact.first
248+
(rules['rules'].map { |entry| entry.last if name.match(entry.first) } + [rules['default']]).compact.first
249249
end
250250

251251
# Generate an array of sections
@@ -257,20 +257,20 @@ def self.format_file(_filename, providers)
257257
auto_interfaces = providers.select { |provider| provider.onboot == true }
258258
unless auto_interfaces.empty?
259259
stanza = []
260-
stanza << ('auto ' + auto_interfaces.sort_by{ |provider| interface_order(provider.name, provider.order_rules) }.map(&:name).join(' '))
260+
stanza << ('auto ' + auto_interfaces.sort_by { |provider| interface_order(provider.name, provider.order_rules) }.map(&:name).join(' '))
261261
contents << stanza.join("\n")
262262
end
263263

264264
# Add hotpluggable interfaces
265265
hotplug_interfaces = providers.select { |provider| provider.hotplug == true }
266266
unless hotplug_interfaces.empty?
267267
stanza = []
268-
stanza << ('allow-hotplug ' + hotplug_interfaces.sort_by{ |provider| interface_order(provider.name, provider.order_rules) }.map(&:name).join(' '))
268+
stanza << ('allow-hotplug ' + hotplug_interfaces.sort_by { |provider| interface_order(provider.name, provider.order_rules) }.map(&:name).join(' '))
269269
contents << stanza.join("\n")
270270
end
271271

272272
# Build iface stanzas
273-
providers.sort_by{ |provider| interface_order(provider.name, provider.order_rules) }.each do |provider|
273+
providers.sort_by { |provider| interface_order(provider.name, provider.order_rules) }.each do |provider|
274274
# TODO: add validation method
275275
raise Puppet::Error, "#{provider.name} does not have a method." if provider.method.nil?
276276
raise Puppet::Error, "#{provider.name} does not have a family." if provider.family.nil?

0 commit comments

Comments
 (0)