Minor fixes
This commit is contained in:
parent
e6cee09429
commit
077c53c5be
|
@ -4,10 +4,8 @@ from bonsai.ldapvaluelist import LDAPValueList
|
|||
import bonsai.errors
|
||||
|
||||
from phi.exceptions import (
|
||||
PhiAttributeMissing,
|
||||
PhiEntryDoesNotExist,
|
||||
PhiEntryExists,
|
||||
PhiUnauthorized,
|
||||
PhiUnexpectedRuntimeValue,
|
||||
PhiCannotExecute,
|
||||
)
|
||||
|
@ -48,6 +46,8 @@ class Singleton(object):
|
|||
name = f"{cls.__name__}-{args[0]}-{id(client)}"
|
||||
else:
|
||||
name = f"{cls.__name__}-{id(client)}"
|
||||
if not hasattr(cls, "_instances"):
|
||||
cls._instances = dict()
|
||||
if name not in cls._instances:
|
||||
cls._instances[name] = object.__new__(cls)
|
||||
return cls._instances[name]
|
||||
|
|
|
@ -4,6 +4,9 @@ from bonsai import LDAPEntry
|
|||
from multidict import MultiDict
|
||||
|
||||
from phi.async_ldap import mixins
|
||||
from phi.exceptions import (
|
||||
PhiUnexpectedRuntimeValue,
|
||||
)
|
||||
|
||||
|
||||
def parse_dn(dn):
|
||||
|
@ -60,7 +63,7 @@ class Service(mixins.Member, mixins.Entry, mixins.Singleton):
|
|||
ldap_attributes = ["uid", "ou", "userPassword"]
|
||||
|
||||
async def iter_groups(self): # To be monkeypatched later
|
||||
pass # pragma: no cover
|
||||
raise NotImplemented
|
||||
|
||||
async def groups(self):
|
||||
return [g async for g in self.iter_groups()]
|
||||
|
|
Loading…
Reference in New Issue
Block a user