Replace deprecated "decodestring()" by "decodebytes()"

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

The same has been done for nova:
https://review.openstack.org/#/c/610401/

Change-Id: I81d33a166602fbcf927ea62787db019e380b52aa
This commit is contained in:
Vu Cong Tuan 2018-11-02 16:09:47 +07:00
parent fc81200315
commit c5b72675b0
1 changed files with 1 additions and 1 deletions

View File

@ -333,7 +333,7 @@ def secrets_storage_joined(relation_id=None):
def secrets_storage_changed():
vault_ca = relation_get('vault_ca')
if vault_ca:
vault_ca = base64.decodestring(json.loads(vault_ca).encode())
vault_ca = base64.decodebytes(json.loads(vault_ca).encode())
write_file('/usr/local/share/ca-certificates/vault-ca.crt',
vault_ca, perms=0o644)
subprocess.check_call(['update-ca-certificates', '--fresh'])