Fix interfaces without addresses2

On some of my systems, I have a bond interface that doesn't have an address. Without this change, Chef crashes when it tries to iterate over the null addrs["addresses"] element.
I had to split it to several functions because of cyclic complexity.