From cfac2f811e9e57c94d604646f77a69d5593eef98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Tue, 10 Mar 2015 21:12:44 +0100 Subject: [PATCH] =?UTF-8?q?Si=20l'arit=C3=A9=20des=20fonctions=20n'est=20p?= =?UTF-8?q?as=20compatible=20avec=20les=20arguments,=20on=20loggue,=20sans?= =?UTF-8?q?=20crasher.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/trigger/trigger.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gestion/trigger/trigger.py b/gestion/trigger/trigger.py index a1140a3a..b21d23c0 100755 --- a/gestion/trigger/trigger.py +++ b/gestion/trigger/trigger.py @@ -75,9 +75,9 @@ class EvenementListener(cmb.AsynchronousConsumer): trigger_service(about)(*body) else: raise AttributeError - except AttributeError: - LOGGER.warning('No suitable trigger found for message # %s from %s: %s on host %s. Discarding it.', - basic_deliver.delivery_tag, properties.app_id, body, HOSTNAME) + except (AttributeError, TypeError) as error_message: + 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, traceback.format_exc(), body) self.acknowledge_message(basic_deliver.delivery_tag) @@ -127,9 +127,9 @@ if __name__ == '__main__': for host_service in trigger_config.services[HOSTNAME]: try: print affichage.style(" (Ré)Génération du service %s" % (host_service,), "cyan") - trigger_service(host_service)(True) - except AttributeError: - print "No suitable trigger handle found for service %s on host %s" % (host_service, HOSTNAME) + trigger_service(host_service)('full_regeneration', True) + except (AttributeError, TypeError): + 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: # Daemonize the trigger app, in order to listen and execute commands from civet. daemonize()