From 550a4761cee5a04565637532f38698644bcc23d5 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Thu, 23 Apr 2020 20:29:55 +0000 Subject: [PATCH] Adapt msg passing in bright account create to fit task manager --- brightcm_account_create.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/brightcm_account_create.py b/brightcm_account_create.py index ed6c71b..2c57b30 100644 --- a/brightcm_account_create.py +++ b/brightcm_account_create.py @@ -37,7 +37,8 @@ def bright_account_create(ch, method, properties, body): if not args.dry_run: popen(cmd) logger.info(f'Bright command to create user:{cmd}') - success = True + msg['task'] = task + msg['success'] = True except Exception: logger.exception("Fatal error:") @@ -48,22 +49,10 @@ def bright_account_create(ch, method, properties, body): logger.debug('rc_rmq.publish_msg()') rc_rmq.publish_msg({ 'routing_key': 'confirm.' + username, - 'msg': { - 'task': task, - 'success': success - } + 'msg': msg }) logger.info('confirmation sent') - if success: - # send create message to verify dir permissions agent - logger.debug(f'The task {task} finished successfully') - rc_rmq.publish_msg({ - 'routing_key': 'verify.' + username, - 'msg': msg - }) - logger.info('verify msg sent to next agent') - logger.info("Start listening to queue: {}".format(task)) rc_rmq.start_consume({ 'queue': task, -- GitLab