mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-22 10:21:25 -07:00
[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:
parent
7db1613730
commit
cb939cbb75
11 changed files with 26 additions and 30 deletions
|
@ -88,8 +88,7 @@ from ansible.module_utils.basic import AnsibleModule
|
|||
|
||||
def info_strategy(api, wished_cn):
|
||||
cn_list = api.fetch_all_resources("namespaces")
|
||||
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 namespace lookup: Unable to find container namespace named '%s' in project '%s'" % (wished_cn["name"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue