Skip to content

Commit 4551ebf

Browse files
daveed12root
authored and
root
committed
Fix dictionary changed size during iteration error
1 parent 49c2956 commit 4551ebf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hubblestack/extmods/grains/cloud_details.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def _get_aws_details():
7373
headers=aws_token_header, timeout=3, proxies=proxies)
7474
if r.status_code == requests.codes.ok:
7575
aws_extra['cloud_private_hostname'] = r.text
76-
for key in aws_extra.keys():
76+
for key in list(aws_extra):
7777
if not aws_extra[key]:
7878
aws_extra.pop(key)
7979

@@ -133,7 +133,7 @@ def _get_azure_details():
133133
grain_name_mac = "cloud_interface_{0}_mac_address".format(counter)
134134
azure_extra[grain_name_mac] = value['macAddress']
135135

136-
for key in azure_extra:
136+
for key in list(azure_extra):
137137
if not azure_extra[key]:
138138
azure_extra.pop(key)
139139

0 commit comments

Comments
 (0)