Skip to content
Snippets Groups Projects
Commit 2ade76c5 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Merge branch 'feat-default-group' into 'main'

Add user to default groups

Closes gpfs5-migration#22

See merge request rc/rabbitmq_agents!153
parents 9bc2cd8d 033e13d3
No related branches found
No related tags found
1 merge request!153Add user to default groups
Pipeline #11387 passed with stage
in 2 minutes and 9 seconds
......@@ -266,13 +266,25 @@ def task_manager(ch, method, properties, body):
# Send trigger message
rc_rmq.publish_msg({"routing_key": routing_key, "msg": message})
if task_name == "create_account" and success and rcfg.default_groups:
rc_rmq.publish_msg(
{
"routing_key": "group_member.add",
"msg": {
"groups": {"add": rcfg.default_groups},
"username": username,
"host": msg.get("host"),
"updated_by": msg.get("updated_by"),
"interface": msg.get("interface"),
},
}
)
logger.debug(f"Trigger message '{routing_key}' sent")
logger.debug("Previous level messages acknowledged")
# Send report to admin
if completed or terminated:
notify_admin(username, current)
update_db(username, {"reported": True})
......@@ -295,7 +307,6 @@ def timeout_handler(signum, frame):
delta = current_time - tracking[user]["last_update"]
if delta.seconds > timeout:
rc_rmq.publish_msg(
{
"routing_key": "complete." + user,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment