Skip to content
Snippets Groups Projects

Add user to default groups

Merged Bo-Chun Chen requested to merge louistw/rabbitmq_agents:feat-default-group into main
1 unresolved thread
1 file
+ 13
2
Compare changes
  • Side-by-side
  • Inline
@@ -266,13 +266,25 @@ def task_manager(ch, method, properties, body):
@@ -266,13 +266,25 @@ def task_manager(ch, method, properties, body):
# Send trigger message
# Send trigger message
rc_rmq.publish_msg({"routing_key": routing_key, "msg": message})
rc_rmq.publish_msg({"routing_key": routing_key, "msg": message})
 
if task_name == "create_account" and success and rcfg.default_groups:
    • Maybe use rcfg.supplemental_groups rcfg.migration_groups instead of rcfg.default_groups to follow Unix conventions to define additional groups beside the primary group.

      Sometimes default_groups can be confused with primary_group

Please register or sign in to reply
 
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(f"Trigger message '{routing_key}' sent")
logger.debug("Previous level messages acknowledged")
logger.debug("Previous level messages acknowledged")
# Send report to admin
# Send report to admin
if completed or terminated:
if completed or terminated:
notify_admin(username, current)
notify_admin(username, current)
update_db(username, {"reported": True})
update_db(username, {"reported": True})
@@ -295,7 +307,6 @@ def timeout_handler(signum, frame):
@@ -295,7 +307,6 @@ def timeout_handler(signum, frame):
delta = current_time - tracking[user]["last_update"]
delta = current_time - tracking[user]["last_update"]
if delta.seconds > timeout:
if delta.seconds > timeout:
rc_rmq.publish_msg(
rc_rmq.publish_msg(
{
{
"routing_key": "complete." + user,
"routing_key": "complete." + user,
Loading