mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
use dict comprehension in plugins, part 4 (#8858)
* use dict comprehension in plugins, part 4 * add changelog frag
This commit is contained in:
@@ -96,8 +96,7 @@ from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
def info_strategy(api, wished_fn):
|
||||
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:
|
||||
msg = "Error during function lookup: Unable to find function named '%s' in namespace '%s'" % (wished_fn["name"],
|
||||
|
||||
Reference in New Issue
Block a user