certprofile plugin: Use binary mode for file with binary data

Part of the work for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
Petr Viktorin
2016-04-29 17:35:01 +02:00
committed by Martin Basti
parent bdee890014
commit 6ddf0d657f

View File

@@ -224,7 +224,7 @@ class certprofile_show(LDAPRetrieve):
result = super(certprofile_show, self).forward(*keys, **options)
if 'out' in options and 'config' in result['result']:
with open(options['out'], 'w') as f:
with open(options['out'], 'wb') as f:
f.write(result['result'].pop('config'))
result['summary'] = (
_("Profile configuration stored in file '%(file)s'")