mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Do not resize while iterating
This commit is contained in:
parent
e6251e78eb
commit
4f2abe5cba
@ -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'])
|
||||
|
Loading…
Reference in New Issue
Block a user