mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
use dict comprehension in plugins, part 2 (#8822)
* use dict comprehension in plugins * add changelog frag
This commit is contained in:
parent
ecc048bc12
commit
7e978c77b4
21 changed files with 76 additions and 68 deletions
|
@ -51,11 +51,11 @@ def scaleway_waitable_resource_argument_spec():
|
|||
|
||||
|
||||
def payload_from_object(scw_object):
|
||||
return dict(
|
||||
(k, v)
|
||||
return {
|
||||
k: v
|
||||
for k, v in scw_object.items()
|
||||
if k != 'id' and v is not None
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
class ScalewayException(Exception):
|
||||
|
@ -117,10 +117,7 @@ class SecretVariables(object):
|
|||
@staticmethod
|
||||
def list_to_dict(source_list, hashed=False):
|
||||
key_value = 'hashed_value' if hashed else 'value'
|
||||
return dict(
|
||||
(var['key'], var[key_value])
|
||||
for var in source_list
|
||||
)
|
||||
return {var['key']: var[key_value] for var in source_list}
|
||||
|
||||
@classmethod
|
||||
def decode(cls, secrets_list, values_list):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue