mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 20:17:15 +00:00
[PR #10891/5f471b8e backport][stable-11] refactor dict from literal list (#10895)
refactor dict from literal list (#10891)
* refactor dict from literal list
* add changelog frag
(cherry picked from commit 5f471b8e5b)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
8685d12996
commit
32438bdf80
6 changed files with 17 additions and 14 deletions
|
|
@ -109,10 +109,7 @@ class SecretVariables(object):
|
|||
|
||||
@staticmethod
|
||||
def dict_to_list(source_dict):
|
||||
return [
|
||||
dict(key=var[0], value=var[1])
|
||||
for var in source_dict.items()
|
||||
]
|
||||
return [dict(key=k, value=v) for k, v in source_dict.items()]
|
||||
|
||||
@staticmethod
|
||||
def list_to_dict(source_list, hashed=False):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue