mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-08 11:50:28 -07:00
WIP: Ansible: gcp_iam_service_account_key: python3 TypeError - add decode to variable assignment (#286)
Signed-off-by: Modular Magician <magic-modules@google.com>
This commit is contained in:
parent
6cbcd4c21e
commit
bd7385b777
1 changed files with 2 additions and 1 deletions
|
@ -152,6 +152,7 @@ path:
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest, replace_resource_dict
|
from ansible.module_utils.gcp_utils import navigate_hash, GcpSession, GcpModule, GcpRequest, replace_resource_dict
|
||||||
|
from ansible.module_utils._text import to_native
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import mimetypes
|
import mimetypes
|
||||||
|
@ -204,7 +205,7 @@ def create(module):
|
||||||
auth = GcpSession(module, 'iam')
|
auth = GcpSession(module, 'iam')
|
||||||
json_content = return_if_object(module, auth.post(self_link(module), resource_to_request(module)))
|
json_content = return_if_object(module, auth.post(self_link(module), resource_to_request(module)))
|
||||||
with open(module.params['path'], 'w') as f:
|
with open(module.params['path'], 'w') as f:
|
||||||
private_key_contents = base64.b64decode(json_content['privateKeyData'])
|
private_key_contents = to_native(base64.b64decode(json_content['privateKeyData']))
|
||||||
f.write(private_key_contents)
|
f.write(private_key_contents)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue