mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Singleton OK
This commit is contained in:
parent
87af557bf1
commit
bf96220a27
2 changed files with 10 additions and 9 deletions
|
@ -145,8 +145,6 @@ def parse_dict(action_map):
|
||||||
|
|
||||||
args = parsers['general'].parse_args(sys.argv.extend(new_args))
|
args = parsers['general'].parse_args(sys.argv.extend(new_args))
|
||||||
args_dict = vars(args)
|
args_dict = vars(args)
|
||||||
print patterns
|
|
||||||
print args_dict
|
|
||||||
for key, value in patterns.items():
|
for key, value in patterns.items():
|
||||||
validate(value, args_dict[key])
|
validate(value, args_dict[key])
|
||||||
|
|
||||||
|
|
17
yunohost.py
17
yunohost.py
|
@ -226,7 +226,10 @@ class YunoHostLDAP(Singleton):
|
||||||
raise YunoHostError(13, _('Invalid credentials'))
|
raise YunoHostError(13, _('Invalid credentials'))
|
||||||
|
|
||||||
def __exit__(self, type, value, traceback):
|
def __exit__(self, type, value, traceback):
|
||||||
self.disconnect()
|
try:
|
||||||
|
self.disconnect()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
def disconnect(self):
|
def disconnect(self):
|
||||||
"""
|
"""
|
||||||
|
@ -236,12 +239,12 @@ class YunoHostLDAP(Singleton):
|
||||||
Boolean | YunoHostError
|
Boolean | YunoHostError
|
||||||
|
|
||||||
"""
|
"""
|
||||||
#try:
|
try:
|
||||||
self.conn.unbind_s()
|
self.conn.unbind_s()
|
||||||
#except:
|
except:
|
||||||
# raise YunoHostError(169, _('An error occured during disconnection'))
|
raise YunoHostError(169, _('An error occured during disconnection'))
|
||||||
#else:
|
else:
|
||||||
# return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def search(self, base=None, filter='(objectClass=*)', attrs=['dn']):
|
def search(self, base=None, filter='(objectClass=*)', attrs=['dn']):
|
||||||
|
|
Loading…
Add table
Reference in a new issue