encodestring() instead of b64encode()

This commit is contained in:
Daan Hoogland 2021-02-26 13:19:09 +01:00
parent d17360cf83
commit 73f5ff207b
3 changed files with 3 additions and 3 deletions

View File

@ -1000,7 +1000,7 @@ class ConfigDriveUtils:
:rtype: str
"""
self.debug("Updating userdata for VM - %s" % vm.name)
updated_user_data = base64.b64encode(new_user_data)
updated_user_data = base64.encodestring(new_user_data)
with self.stopped_vm(vm):
vm.update(self.api_client, userdata=updated_user_data)

View File

@ -126,7 +126,7 @@ class TestDeployVmWithUserDataMultiNic(cloudstackTestCase):
"""Test userdata update when non default nic is without userdata for deploy and update
"""
self.userdata = base64.b64encode(self.userdata)
self.userdata = base64.encodestring(self.userdata)
network1 = Network.create(
self.apiclient,

View File

@ -111,7 +111,7 @@ class TestDeployVmWithUserData(cloudstackTestCase):
"""
self.userdata=base64.b64encode(self.userdata)
self.userdata=base64.encodestring(self.userdata)
self.services["virtual_machine"]["userdata"] = self.userdata
deployVmResponse = VirtualMachine.create(