From 1b506c7210655ca2f4ea844cd076e44869d6e6a2 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 26 Nov 2015 14:08:05 +0000 Subject: [PATCH] Fix error when a host has no interfaces declared --- cookbooks/networking/libraries/interfaces.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/networking/libraries/interfaces.rb b/cookbooks/networking/libraries/interfaces.rb index cd9116dfa..029cb4f32 100644 --- a/cookbooks/networking/libraries/interfaces.rb +++ b/cookbooks/networking/libraries/interfaces.rb @@ -4,7 +4,7 @@ class Chef interfaces = [] networking = construct_attributes[:networking] || {} - networking_interfaces = networking[:interfaces] || [] + networking_interfaces = networking[:interfaces] || {} networking_interfaces.each_value do |interface| next unless options[:role].nil? || interface[:role].to_s == options[:role].to_s -- 2.39.5