NSX|V: Fix devstack cleanup for python 3

fix base 64 encodeing and integer casting for python3

Change-Id: I3c9bcc41ac1c18b4754465de0e95e42ea0825c81
This commit is contained in:
Adit Sarfaty 2018-09-16 09:37:55 +03:00
parent 8f39db15b8
commit 958b196601
1 changed files with 2 additions and 2 deletions

View File

@ -155,7 +155,7 @@ class VSMClient(object):
content_type = self.content_type if content is None else content
accept_type = self.accept_type if accept is None else accept
auth_cred = self.username + ":" + self.password
auth = base64.b64encode(auth_cred)
auth = base64.b64encode(auth_cred.encode()).decode()
headers = {}
headers['Authorization'] = "Basic %s" % auth
headers['Content-Type'] = content_type
@ -396,7 +396,7 @@ def ceil(a, b):
return 0
div = a / b
mod = 0 if a % b is 0 else 1
return div + mod
return int(div + mod)
if __name__ == "__main__":