From 3d0919aa9925f3779bec37eedb80593f1116a72e Mon Sep 17 00:00:00 2001 From: Gene Tomilko Date: Mon, 18 May 2020 14:14:27 -0700 Subject: [PATCH] Add .encode function Add .encode function to ipm_username and ipm_password to make it work in Python 3 --- eip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eip.py b/eip.py index 1c3cb45..0d94125 100644 --- a/eip.py +++ b/eip.py @@ -30,8 +30,8 @@ class Eip(object): def __init__(self,module,ipm_server,ipm_username, ipm_password): self.module = module self.ipm_auth_hdr = { - 'X-IPM-Username': base64.b64encode(ipm_username), - 'X-IPM-Password': base64.b64encode(ipm_password) + 'X-IPM-Username': base64.b64encode(ipm_username.encode()), + 'X-IPM-Password': base64.b64encode(ipm_password.encode()) } self.base_url = "https://{host}/".format(host=ipm_server)