Connection bug fix

This commit is contained in:
Kloadut 2012-10-14 17:44:16 +02:00
parent 4324ebe8fb
commit 401494549b

View file

@ -491,7 +491,7 @@ def connect_services(action_map):
action_map -- Map of actions action_map -- Map of actions
Returns: Returns:
Dict|int -- openned connections or error code Dict -- openned connections or error code
""" """
action_dict = action_map[sys.argv[1]]['actions'][sys.argv[2]] action_dict = action_map[sys.argv[1]]['actions'][sys.argv[2]]
@ -510,7 +510,7 @@ def connect_services(action_map):
# TODO: Add other services connections # TODO: Add other services connections
except YunoHostError, error: except YunoHostError, error:
display_error(error) display_error(error)
return error.code sys.exit(error.code)
else: else:
return connections return connections
@ -522,10 +522,11 @@ def disconnect_services(connections):
connections -- Dictionnary of openned connections connections -- Dictionnary of openned connections
Returns: Returns:
Boolean|int Boolean
""" """
try: try:
print connections
if 'ldap' in connections: if 'ldap' in connections:
connections['ldap'].disconnect() connections['ldap'].disconnect()
if 'firewall' in connections: if 'firewall' in connections:
@ -533,7 +534,7 @@ def disconnect_services(connections):
# TODO: Add other services deconnections # TODO: Add other services deconnections
except YunoHostError, error: except YunoHostError, error:
display_error(error) display_error(error)
return error.code sys.exit(error.code)
else: else:
return True return True