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