Skip to content

Commit 3e52f47

Browse files
rmfitzpatrickryansb
authored andcommitted
[cloud] Fixes ansible#26045 Ensure instance.instance_profile is not None before casting to dict (ansible#26047)
1 parent a439f45 commit 3e52f47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ansible/modules/cloud/amazon/ec2_remote_facts.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,11 @@ def get_instance_info(instance):
108108
except AttributeError:
109109
pass
110110

111+
instance_profile = dict(instance.instance_profile) if instance.instance_profile is not None else None
112+
111113
instance_info = { 'id': instance.id,
112114
'kernel': instance.kernel,
113-
'instance_profile': dict(instance.instance_profile),
115+
'instance_profile': instance_profile,
114116
'root_device_type': instance.root_device_type,
115117
'private_dns_name': instance.private_dns_name,
116118
'public_dns_name': instance.public_dns_name,

0 commit comments

Comments
 (0)