[PR #8858/94472dd7 backport][stable-9] use dict comprehension in plugins, part 4 (#8865)

use dict comprehension in plugins, part 4 (#8858)

* use dict comprehension in plugins, part 4

* add changelog frag

(cherry picked from commit 94472dd7e5)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2024-09-13 22:58:57 +02:00 committed by GitHub
parent 7db1613730
commit cb939cbb75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 26 additions and 30 deletions

View file

@ -245,8 +245,7 @@ def absent_strategy(api, wished_fn):
changed = False
fn_list = api.fetch_all_resources("functions")
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, {}
@ -270,8 +269,7 @@ def present_strategy(api, wished_fn):
changed = False
fn_list = api.fetch_all_resources("functions")
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)