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)
|
||||
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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue