mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
vultr: fix py3 compat (#37171)
* vr_server: fix base64 encoding with py3 * vultr: fix AttributeError with py3
This commit is contained in:
parent
155adb1631
commit
4b6b2d4206
2 changed files with 10 additions and 3 deletions
|
@ -320,6 +320,7 @@ vultr_server:
|
|||
import time
|
||||
import base64
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils._text import to_text, to_bytes
|
||||
from ansible.module_utils.vultr import (
|
||||
Vultr,
|
||||
vultr_argument_spec,
|
||||
|
@ -415,7 +416,7 @@ class AnsibleVultrServer(Vultr):
|
|||
def get_user_data(self):
|
||||
user_data = self.module.params.get('user_data')
|
||||
if user_data is not None:
|
||||
user_data = base64.b64encode(str(user_data))
|
||||
user_data = to_text(base64.b64encode(to_bytes(user_data)))
|
||||
return user_data
|
||||
|
||||
def get_server_user_data(self, server):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue