Replace deprecated "decodestring()"

"decodestring()" is deprecated alias of "decodebytes()"
https://docs.python.org/3/library/base64.html#base64.decodestring

This patch replaces "base64.decodestring" with
"oslo_serialization.base64.decode_as_bytes".
The same has been done for nova:
https://review.openstack.org/#/c/610401/

Change-Id: I604afb9cd34b7ff6695031dc271930e49ed80bcf
This commit is contained in:
Vu Cong Tuan 2018-11-02 16:32:07 +07:00
parent 7e7a43b829
commit 0e76aff90c
1 changed files with 2 additions and 2 deletions

View File

@ -15,7 +15,6 @@
# under the License.
import random
import socket
import base64
import time
from threading import Lock
@ -25,6 +24,7 @@ import dns.exception
import dns.zone
import eventlet
from dns import rdatatype
from oslo_serialization import base64
from oslo_log import log as logging
from oslo_config import cfg
@ -192,7 +192,7 @@ class TsigKeyring(object):
tsigkey = self.storage.find_tsigkey(
context.get_current(), criterion)
return base64.decodestring(tsigkey.secret)
return base64.decode_as_bytes(tsigkey.secret)
except exceptions.TsigKeyNotFound:
return default