This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository lib389.
commit d304445ad9007dc892a4d6dcbed1b1cfece2a24c
Author: Ilias Stamatis <stamatis.iliass(a)gmail.com>
Date: Sun Aug 13 22:13:29 2017 +0300
Issue 92 - display_attr() should return str not bytes in py3
Bug Description: display_attr method of mapped object returns
bytes in python3. Since we use this function to display display
data to the end user we don't want this.
There is also a bug in get_attr_vals_type() methods. These
methods call a non-existing function due to a typo.
Fix Description: Call get_attr_valus_utf8 instead of get_attr_vals
from within display_attr method. Also fix the bug with the
get_attr_vals_type by correcting the method's name.
https://pagure.io/lib389/issue/92
Author: Ilias95
Review by: wibrown (Thanks!)
---
lib389/_mapped_object.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib389/_mapped_object.py b/lib389/_mapped_object.py
index d4bfd0a..6b50f83 100644
--- a/lib389/_mapped_object.py
+++ b/lib389/_mapped_object.py
@@ -127,7 +127,7 @@ class DSLdapObject(DSLogging):
def display_attr(self, attr):
out = ""
- for v in self.get_attr_vals(attr):
+ for v in self.get_attr_vals_utf8(attr):
out += "%s: %s\n" % (attr, v)
return out
@@ -349,19 +349,19 @@ class DSLdapObject(DSLogging):
return ensure_bytes(self.get_attr_val(key))
def get_attr_vals_bytes(self, key):
- return ensure_list_bytes(self.get_attrs_val(key))
+ return ensure_list_bytes(self.get_attr_vals(key))
def get_attr_val_utf8(self, key):
return ensure_str(self.get_attr_val(key))
def get_attr_vals_utf8(self, key):
- return ensure_list_str(self.get_attrs_val(key))
+ return ensure_list_str(self.get_attr_vals(key))
def get_attr_val_int(self, key):
return ensure_int(self.get_attr_val(key))
def get_attr_vals_int(self, key):
- return ensure_list_int(self.get_attrs_val(key))
+ return ensure_list_int(self.get_attr_vals(key))
# Duplicate, but with many values. IE a dict api.
# This
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.