diff --git a/agent_template.py b/agent_template.py index 07400ae1f95b82c2ac1e1b4902b68a1c14e57dd6..7858bdbfc144b7d2e858fb8fb525e5b4609659bd 100644 --- a/agent_template.py +++ b/agent_template.py @@ -13,9 +13,11 @@ def on_message(ch, method, properties, body): # Retrieve routing key routing_key = method.routing_key + print(routing_key) # Retrieve message msg = json.loads(body) + print(msg) # Do Something print("[{}]: Callback called.".format(task)) diff --git a/prod_rmq_agents/dir_verify.py b/prod_rmq_agents/dir_verify.py index 162dad9852f568f840cb13c1883a7d1ab11669c8..4b768c9428a4f1438eeb2b81d3f84d6d9c5c1ebc 100644 --- a/prod_rmq_agents/dir_verify.py +++ b/prod_rmq_agents/dir_verify.py @@ -51,7 +51,7 @@ def dir_verify(ch, method, properties, body): " wrong" ) - except Exception as exception: + except Exception: msg["success"] = False msg["errmsg"] = "Exception raised, check the logs for stack trace" logger.error("", exc_info=True) diff --git a/prod_rmq_agents/get-next-uid-gid.py b/prod_rmq_agents/get-next-uid-gid.py index 2695ce61f93a938f770e3401900a85f5609e2920..42d6cc892b138253c9e3aad2af2f0512357dce16 100644 --- a/prod_rmq_agents/get-next-uid-gid.py +++ b/prod_rmq_agents/get-next-uid-gid.py @@ -80,7 +80,7 @@ def resolve_uid_gid(ch, method, properties, body): create_account(msg) msg["task"] = task msg["success"] = True - except Exception as exception: + except Exception: msg["success"] = False msg["errmsg"] = ( "Exception raised during account creation, check logs for stack" diff --git a/prod_rmq_agents/git_commit.py b/prod_rmq_agents/git_commit.py index 38d6f8ee72bedca00e651986762f5d2f8d83ee9a..c8665c17d3a596fa80923cf64b3b333e490a8034 100644 --- a/prod_rmq_agents/git_commit.py +++ b/prod_rmq_agents/git_commit.py @@ -111,7 +111,7 @@ def git_commit(ch, method, properties, body): logger.info("Added ldif files and committed to git repo") msg["success"] = True - except Exception as exception: + except Exception: logger.error("", exc_info=True) # Send confirm message diff --git a/prod_rmq_agents/notify_user.py b/prod_rmq_agents/notify_user.py index 5e26547c004d0e1888f62362443982a12578c86c..d204bad3d1e0e2b73862f98683672a0aef41f6a3 100644 --- a/prod_rmq_agents/notify_user.py +++ b/prod_rmq_agents/notify_user.py @@ -87,7 +87,7 @@ def notify_user(ch, method, properties, body): logger.debug(f"User {username} inserted into database") msg["success"] = True - except Exception as exception: + except Exception: logger.error("", exc_info=True) msg["errmsg"] = errmsg if errmsg else "Unexpected error" diff --git a/prod_rmq_agents/subscribe_mail_lists.py b/prod_rmq_agents/subscribe_mail_lists.py index 8003ea73dd42bc127e043f99485f78e80bda18e5..a70d007e54721979bd82ef03b4216710a9c74303 100644 --- a/prod_rmq_agents/subscribe_mail_lists.py +++ b/prod_rmq_agents/subscribe_mail_lists.py @@ -61,7 +61,7 @@ def mail_list_subscription(ch, method, properties, body): s.quit() msg["task"] = task msg["success"] = True - except Exception as exception: + except Exception: logger.error("", exc_info=True) # Acknowledge message diff --git a/prod_rmq_agents/task_manager.py b/prod_rmq_agents/task_manager.py index 9ad0b78bcdccfc679790fc983f67d65cb517a851..e2e3edc5a746e13c319df8a7f40e4a9bc539a930 100644 --- a/prod_rmq_agents/task_manager.py +++ b/prod_rmq_agents/task_manager.py @@ -259,7 +259,7 @@ def task_manager(ch, method, properties, body): logger.debug(f"Notify level {task_name}? {success}") - except Exception as exception: + except Exception: logger.error("", exc_info=True) if send: