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 authored and Martin Basti committed 2016-05-05 16:42:46 +02:00
1 parent bdee890014
commit 6ddf0d657f
1 file changed
+1 -1
+1 -1
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'")