From 10c96c29780e4653de4f51f467b427be1b07322a Mon Sep 17 00:00:00 2001 From: ljhuang Date: Mon, 22 Aug 2022 16:36:55 +0800 Subject: Replace base64.encodestring with encodebytes Base64.encodestring has been deprecated since 3.1 and removed in python 3.9,Replace it with base64.encodebytes from python3.1[1]. [1]https://docs.python.org/3.9/library/base64.html?highlight=deprecated#base64.encodebytes Change-Id: I80c04cc62b5eb521ec5dcba179964ed1d42d2471 --- cinder/volume/drivers/prophetstor/dplcommon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/volume/drivers/prophetstor/dplcommon.py b/cinder/volume/drivers/prophetstor/dplcommon.py index 2cde1c513..4f0713e6e 100644 --- a/cinder/volume/drivers/prophetstor/dplcommon.py +++ b/cinder/volume/drivers/prophetstor/dplcommon.py @@ -86,8 +86,8 @@ class DPLCommand(object): 'Accept': 'application/cdmi-container', 'x-cdmi-specification-version': '1.0.2'} # base64 encode the username and password - auth = base64.encodestring('%s:%s' - % (self.username, + auth = base64.encodebytes('%s:%s' + % (self.username, self.password)).replace('\n', '') header['Authorization'] = 'Basic %s' % auth -- cgit v1.2.1