You should check if ```port_bindings is not None``` before calling iteritems()