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:
parent
7e7a43b829
commit
0e76aff90c
|
@ -15,7 +15,6 @@
|
||||||
# under the License.
|
# under the License.
|
||||||
import random
|
import random
|
||||||
import socket
|
import socket
|
||||||
import base64
|
|
||||||
import time
|
import time
|
||||||
from threading import Lock
|
from threading import Lock
|
||||||
|
|
||||||
|
@ -25,6 +24,7 @@ import dns.exception
|
||||||
import dns.zone
|
import dns.zone
|
||||||
import eventlet
|
import eventlet
|
||||||
from dns import rdatatype
|
from dns import rdatatype
|
||||||
|
from oslo_serialization import base64
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ class TsigKeyring(object):
|
||||||
tsigkey = self.storage.find_tsigkey(
|
tsigkey = self.storage.find_tsigkey(
|
||||||
context.get_current(), criterion)
|
context.get_current(), criterion)
|
||||||
|
|
||||||
return base64.decodestring(tsigkey.secret)
|
return base64.decode_as_bytes(tsigkey.secret)
|
||||||
|
|
||||||
except exceptions.TsigKeyNotFound:
|
except exceptions.TsigKeyNotFound:
|
||||||
return default
|
return default
|
||||||
|
|
Loading…
Reference in New Issue