Si l'arité des fonctions n'est pas compatible avec les arguments, on loggue, sans crasher.
This commit is contained in:
parent
4bc4cb7abe
commit
cfac2f811e
1 changed files with 6 additions and 6 deletions
|
@ -75,9 +75,9 @@ class EvenementListener(cmb.AsynchronousConsumer):
|
||||||
trigger_service(about)(*body)
|
trigger_service(about)(*body)
|
||||||
else:
|
else:
|
||||||
raise AttributeError
|
raise AttributeError
|
||||||
except AttributeError:
|
except (AttributeError, TypeError) as error_message:
|
||||||
LOGGER.warning('No suitable trigger found for message # %s from %s: %s on host %s. Discarding it.',
|
LOGGER.warning('No suitable trigger found for message # %s from %s: %s on host %s. Discarding it. (traceback: %r) (args: %r)',
|
||||||
basic_deliver.delivery_tag, properties.app_id, body, HOSTNAME)
|
basic_deliver.delivery_tag, properties.app_id, body, HOSTNAME, traceback.format_exc(), body)
|
||||||
|
|
||||||
self.acknowledge_message(basic_deliver.delivery_tag)
|
self.acknowledge_message(basic_deliver.delivery_tag)
|
||||||
|
|
||||||
|
@ -127,9 +127,9 @@ if __name__ == '__main__':
|
||||||
for host_service in trigger_config.services[HOSTNAME]:
|
for host_service in trigger_config.services[HOSTNAME]:
|
||||||
try:
|
try:
|
||||||
print affichage.style(" (Ré)Génération du service %s" % (host_service,), "cyan")
|
print affichage.style(" (Ré)Génération du service %s" % (host_service,), "cyan")
|
||||||
trigger_service(host_service)(True)
|
trigger_service(host_service)('full_regeneration', True)
|
||||||
except AttributeError:
|
except (AttributeError, TypeError):
|
||||||
print "No suitable trigger handle found for service %s on host %s" % (host_service, HOSTNAME)
|
print "No suitable trigger handle found for service %s on host %s. Perhaps True is not accepted as a keyword." % (host_service, HOSTNAME)
|
||||||
elif ARGS.daemon:
|
elif ARGS.daemon:
|
||||||
# Daemonize the trigger app, in order to listen and execute commands from civet.
|
# Daemonize the trigger app, in order to listen and execute commands from civet.
|
||||||
daemonize()
|
daemonize()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue