We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dab0e75 commit f5f7a8cCopy full SHA for f5f7a8c
lib/ansible/modules/cloud/amazon/ec2_eni.py
@@ -483,9 +483,6 @@ def find_eni(connection, module):
483
instance_id = module.params.get('instance_id')
484
device_index = module.params.get('device_index')
485
486
- if not eni_id:
487
- return None
488
-
489
try:
490
filters = {}
491
if subnet_id:
@@ -499,7 +496,7 @@ def find_eni(connection, module):
499
496
filters['attachment.device-index'] = device_index
500
497
501
498
eni_result = connection.get_all_network_interfaces(eni_id, filters=filters)
502
- if len(eni_result) > 0:
+ if len(eni_result) == 1:
503
return eni_result[0]
504
else:
505
return None
0 commit comments