vault: fix vault-retrieve to a file

`data` is bytes but we were opening the "--out" file as
a text.

https://pagure.io/freeipa/issue/7430

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Stanislav Laznicka
2018-03-06 09:32:14 +01:00
parent e6ca3b0c73
commit c9c41d2d90

View File

@@ -1143,7 +1143,7 @@ class vault_retrieve(ModVaultData):
error=_('Invalid vault type'))
if output_file:
with open(output_file, 'w') as f:
with open(output_file, 'wb') as f:
f.write(data)
else: