mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Revert a few dict usage cleanups from #17080
Turns out our test coverage is missing a few things, upon closer inspection that change broke a few things that we don't seem to have test coverage for.
This commit is contained in:
parent
c76ab764c2
commit
81bdc9f9be
@ -745,7 +745,7 @@ def reformat_node(item=None, full=False):
|
||||
|
||||
# remove all the extra key value pairs to provide a brief listing
|
||||
if not full:
|
||||
for key in item:
|
||||
for key in item.keys(): # iterate over a copy of the keys
|
||||
if key not in desired_keys:
|
||||
del item[key]
|
||||
|
||||
|
@ -59,7 +59,7 @@ def list_(show_all=False, return_yaml=True):
|
||||
if 'schedule' in __pillar__:
|
||||
schedule.update(__pillar__['schedule'])
|
||||
|
||||
for job in schedule:
|
||||
for job in schedule.keys(): # iterate over a copy since we will mutate it
|
||||
if job == 'enabled':
|
||||
continue
|
||||
|
||||
|
@ -220,7 +220,7 @@ def render(input, saltenv='base', sls='', argline='', **kws):
|
||||
tmplctx = STATE_CONF.copy()
|
||||
if tmplctx:
|
||||
prefix = sls + '::'
|
||||
for k in tmplctx:
|
||||
for k in tmplctx.keys(): # iterate over a copy of keys
|
||||
if k.startswith(prefix):
|
||||
tmplctx[k[len(prefix):]] = tmplctx[k]
|
||||
del tmplctx[k]
|
||||
|
@ -202,7 +202,8 @@ class ZeroMQChannel(Channel):
|
||||
if master_type == 'failover':
|
||||
# remove all cached sreqs to the old master to prevent
|
||||
# zeromq from reconnecting to old masters automagically
|
||||
for check_key in self.sreq_cache:
|
||||
# iterate over a copy since we will mutate the dict
|
||||
for check_key in self.sreq_cache.keys():
|
||||
if self.opts['master_uri'] != check_key[0]:
|
||||
del self.sreq_cache[check_key]
|
||||
log.debug('Removed obsolete sreq-object from '
|
||||
|
@ -819,7 +819,7 @@ class SaltNova(OpenStackComputeShell):
|
||||
'priority', 'project_id', 'vlan_start', 'vpn_start'
|
||||
]
|
||||
|
||||
for variable in kwargs:
|
||||
for variable in kwargs.keys(): # iterate over a copy, we might delete some
|
||||
if variable not in params:
|
||||
del kwargs[variable]
|
||||
return kwargs
|
||||
|
Loading…
Reference in New Issue
Block a user