From de9472a08a06a3b513c21a5d62865d276c38f0c0 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 1 Apr 2015 17:08:43 +0200 Subject: [PATCH] Add default parameter to get_attr method --- LdapServer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LdapServer.py b/LdapServer.py index 2453ad1..611b7bd 100644 --- a/LdapServer.py +++ b/LdapServer.py @@ -105,17 +105,17 @@ class LdapServer(object): def get_dn(self,obj): return obj[0][0] - def get_attr(self,obj,attr,all=None): + def get_attr(self,obj,attr,all=None,default=None): if all is not None: if attr in obj: return obj[attr] else: - return [] + return default or [] else: if attr in obj: return obj[attr][0] else: - return None + return default class LdapServerException(BaseException): def __init__(self,msg):