mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 16:31:26 -07:00
use dict comprehension in plugins, part 4 (#8858)
* use dict comprehension in plugins, part 4 * add changelog frag
This commit is contained in:
parent
37dd6ec8a3
commit
94472dd7e5
11 changed files with 26 additions and 30 deletions
|
@ -168,8 +168,7 @@ def absent_strategy(api, wished_fn):
|
|||
changed = False
|
||||
|
||||
fn_list = api.fetch_all_resources("namespaces")
|
||||
fn_lookup = dict((fn["name"], fn)
|
||||
for fn in fn_list)
|
||||
fn_lookup = {fn["name"]: fn for fn in fn_list}
|
||||
|
||||
if wished_fn["name"] not in fn_lookup:
|
||||
return changed, {}
|
||||
|
@ -193,8 +192,7 @@ def present_strategy(api, wished_fn):
|
|||
changed = False
|
||||
|
||||
fn_list = api.fetch_all_resources("namespaces")
|
||||
fn_lookup = dict((fn["name"], fn)
|
||||
for fn in fn_list)
|
||||
fn_lookup = {fn["name"]: fn for fn in fn_list}
|
||||
|
||||
payload_fn = payload_from_wished_fn(wished_fn)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue