Check whether interface-list exits before querying its length

pull/18777/head
Eike Frost 9 years ago committed by Matt Clay
parent 9fea94b5bf
commit 85f6bb4d8e

@ -288,6 +288,8 @@ class Host(object):
# check the exist_interfaces whether it equals the interfaces or not # check the exist_interfaces whether it equals the interfaces or not
def check_interface_properties(self, exist_interface_list, interfaces): def check_interface_properties(self, exist_interface_list, interfaces):
interfaces_port_list = [] interfaces_port_list = []
if interfaces is not None:
if len(interfaces) >= 1: if len(interfaces) >= 1:
for interface in interfaces: for interface in interfaces:
interfaces_port_list.append(int(interface['port'])) interfaces_port_list.append(int(interface['port']))

Loading…
Cancel
Save