1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Check whether interface-list exits before querying its length

This commit is contained in:
Eike Frost 2016-02-28 20:12:01 +00:00 committed by Matt Clay
parent 9fea94b5bf
commit 85f6bb4d8e

View file

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