mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-21 20:30:21 -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
|
@ -193,13 +193,8 @@ def run_module():
|
|||
|
||||
allowed_keys = ['host', 'port', 'ca_cert', 'cert_cert', 'cert_key',
|
||||
'timeout', 'user', 'password']
|
||||
# TODO(evrardjp): Move this back to a dict comprehension when python 2.7 is
|
||||
# the minimum supported version
|
||||
# client_params = {key: value for key, value in module.params.items() if key in allowed_keys}
|
||||
client_params = dict()
|
||||
for key, value in module.params.items():
|
||||
if key in allowed_keys:
|
||||
client_params[key] = value
|
||||
|
||||
client_params = {key: value for key, value in module.params.items() if key in allowed_keys}
|
||||
try:
|
||||
etcd = etcd3.client(**client_params)
|
||||
except Exception as exp:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue