summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2016-04-29 17:35:01 +0200
committerMartin Basti <mbasti@redhat.com>2016-05-05 16:42:46 +0200
commit6ddf0d657f70eb03d17af2e63eb52d6ef33305be (patch)
tree284c0b8173134a2dd13ea0324240dd361680057d
parentbdee89001455825bfe2c7e820c6b2d651f1f45eb (diff)
downloadfreeipa-6ddf0d657f70eb03d17af2e63eb52d6ef33305be.tar.gz
freeipa-6ddf0d657f70eb03d17af2e63eb52d6ef33305be.tar.xz
freeipa-6ddf0d657f70eb03d17af2e63eb52d6ef33305be.zip
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>
-rw-r--r--ipalib/plugins/certprofile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipalib/plugins/certprofile.py b/ipalib/plugins/certprofile.py
index 6329d84c3..224d5cec8 100644
--- a/ipalib/plugins/certprofile.py
+++ b/ipalib/plugins/certprofile.py
@@ -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'")