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_dict = vars(args)
|
||||
print patterns
|
||||
print args_dict
|
||||
for key, value in patterns.items():
|
||||
validate(value, args_dict[key])
|
||||
|
||||
|
|
17
yunohost.py
17
yunohost.py
|
@ -226,7 +226,10 @@ class YunoHostLDAP(Singleton):
|
|||
raise YunoHostError(13, _('Invalid credentials'))
|
||||
|
||||
def __exit__(self, type, value, traceback):
|
||||
self.disconnect()
|
||||
try:
|
||||
self.disconnect()
|
||||
except:
|
||||
pass
|
||||
|
||||
def disconnect(self):
|
||||
"""
|
||||
|
@ -236,12 +239,12 @@ class YunoHostLDAP(Singleton):
|
|||
Boolean | YunoHostError
|
||||
|
||||
"""
|
||||
#try:
|
||||
self.conn.unbind_s()
|
||||
#except:
|
||||
# raise YunoHostError(169, _('An error occured during disconnection'))
|
||||
#else:
|
||||
# return True
|
||||
try:
|
||||
self.conn.unbind_s()
|
||||
except:
|
||||
raise YunoHostError(169, _('An error occured during disconnection'))
|
||||
else:
|
||||
return True
|
||||
|
||||
|
||||
def search(self, base=None, filter='(objectClass=*)', attrs=['dn']):
|
||||
|
|
Loading…
Add table
Reference in a new issue