summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2015-09-11 14:02:13 +0200
committerJan Cholasta <jcholast@redhat.com>2015-09-17 11:08:43 +0200
commitba5201979dfddcb4ca6bb1b68e786cb964e50bb6 (patch)
tree47b09b736a408be189a899340e07900bb9506c6a /ipalib/plugins
parent23507e6124041ed17f39db211e802495e37520e7 (diff)
downloadfreeipa-ba5201979dfddcb4ca6bb1b68e786cb964e50bb6.tar.gz
freeipa-ba5201979dfddcb4ca6bb1b68e786cb964e50bb6.tar.xz
freeipa-ba5201979dfddcb4ca6bb1b68e786cb964e50bb6.zip
Use bytes instead of str where appropriate
Under Python 2, "str" and "bytes" are synonyms. Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipalib/plugins')
-rw-r--r--ipalib/plugins/baseldap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 81fae1516..4a0224647 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -248,7 +248,7 @@ def entry_to_dict(entry, **options):
for attr in entry:
if attr.lower() == 'attributelevelrights':
value = entry[attr]
- elif entry.conn.get_attribute_type(attr) is str:
+ elif entry.conn.get_attribute_type(attr) is bytes:
value = entry.raw[attr]
else:
value = list(entry.raw[attr])
@@ -1082,7 +1082,7 @@ last, after all sets and adds."""),
try:
entry_attrs[attr].remove(delval)
except ValueError:
- if isinstance(delval, str):
+ if isinstance(delval, bytes):
# This is a Binary value, base64 encode it
delval = unicode(base64.b64encode(delval))
raise errors.AttrValueNotFound(attr=attr, value=delval)