Check whether interface-list exits before querying its length
This commit is contained in:
parent
479f99678b
commit
6acc369377
1 changed files with 5 additions and 3 deletions
|
@ -289,9 +289,11 @@ 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 len(interfaces) >= 1:
|
|
||||||
for interface in interfaces:
|
if interfaces is not None:
|
||||||
interfaces_port_list.append(int(interface['port']))
|
if len(interfaces) >= 1:
|
||||||
|
for interface in interfaces:
|
||||||
|
interfaces_port_list.append(int(interface['port']))
|
||||||
|
|
||||||
exist_interface_ports = []
|
exist_interface_ports = []
|
||||||
if len(exist_interface_list) >= 1:
|
if len(exist_interface_list) >= 1:
|
||||||
|
|
Loading…
Reference in a new issue