Skip to content

Commit 897dad6

Browse files
authored
marvin: replace encodestring for encodebytes (#7027)
Fixes: #6962
1 parent ad21e86 commit 897dad6

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

test/integration/component/test_configdrive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ def when_I_update_userdata(self, vm, new_user_data):
10251025
:rtype: str
10261026
"""
10271027
self.debug("Updating userdata for VM - %s" % vm.name)
1028-
updated_user_data = base64.encodestring(new_user_data.encode()).decode()
1028+
updated_user_data = base64.encodebytes(new_user_data.encode()).decode()
10291029
with self.stopped_vm(vm):
10301030
vm.update(self.api_client, userdata=updated_user_data)
10311031

test/integration/component/test_deploy_vm_userdata_multi_nic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def test_deployvm_multinic(self):
126126
"""Test userdata update when non default nic is without userdata for deploy and update
127127
"""
128128

129-
self.userdata = base64.encodestring(self.userdata.encode()).decode()
129+
self.userdata = base64.encodebytes(self.userdata.encode()).decode()
130130

131131
network1 = Network.create(
132132
self.apiclient,

test/integration/component/test_deploy_vm_userdata_reg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def setUpClass(cls):
9999
# py2 didn't insert any new-lines
100100
# so we now do the encoding in the stored userdata string and remove the '\n's
101101
# to get a good easy string compare in the assert later on.
102-
cls.userdata = base64.encodestring(cls.userdata.encode()).decode().replace('\n', '')
102+
cls.userdata = base64.encodebytes(cls.userdata.encode()).decode().replace('\n', '')
103103
cls.user_data_2k= ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(2000))
104104
cls.user_data_2kl = ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(1900))
105105

tools/marvin/marvin/cloudstackConnection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def __sign(self, payload):
147147
).replace("+", "%20")]
148148
) for r in params]
149149
)
150-
signature = base64.encodestring(
150+
signature = base64.encodebytes(
151151
hmac.new(self.securityKey.encode('utf-8'),
152152
hash_str.encode('utf-8'),
153153
hashlib.sha1).digest()).strip()

tools/ngui/requester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def make_request(command, args, logger, host, port,
6868
str.lower(urllib.quote_plus(str(r[1]))).replace("+",
6969
"%20")]) for r in request])
7070

71-
sig = urllib.quote_plus(base64.encodestring(hmac.new(secretkey, hashStr,
71+
sig = urllib.quote_plus(base64.encodebytes(hmac.new(secretkey, hashStr,
7272
hashlib.sha1).digest()).strip())
7373
request_url += "&signature=%s" % sig
7474
request_url = "%s://%s:%s%s?%s" % (protocol, host, port, path, request_url)

0 commit comments

Comments
 (0)