mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +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:
@@ -97,8 +97,7 @@ from ansible.module_utils.basic import AnsibleModule
|
||||
|
||||
def info_strategy(api, wished_cn):
|
||||
cn_list = api.fetch_all_resources("containers")
|
||||
cn_lookup = dict((fn["name"], fn)
|
||||
for fn in cn_list)
|
||||
cn_lookup = {cn["name"]: cn for cn in cn_list}
|
||||
|
||||
if wished_cn["name"] not in cn_lookup:
|
||||
msg = "Error during container lookup: Unable to find container named '%s' in namespace '%s'" % (wished_cn["name"],
|
||||
|
||||
Reference in New Issue
Block a user