Skip to content

Commit

Permalink
Merge pull request #25248 from techhat/issue22391
Browse files Browse the repository at this point in the history
Do not resize while iterating
  • Loading branch information
Nicole Thomas committed Jul 8, 2015
2 parents 631cee1 + 4f2abe5 commit 679cdba
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion salt/cloud/clouds/joyent.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,14 @@ def reformat_node(item=None, full=False):
item[key] = None

# remove all the extra key value pairs to provide a brief listing
to_del = []
if not full:
for key in six.iterkeys(item): # iterate over a copy of the keys
if key not in desired_keys:
del item[key]
to_del.append(key)

for key in to_del:
del item[key]

if 'state' in item:
item['state'] = joyent_node_state(item['state'])
Expand Down

0 comments on commit 679cdba

Please sign in to comment.