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

Send additional info to group member agent

parent 8ca10435
No related branches found
No related tags found
No related merge requests found
......@@ -2,14 +2,13 @@
import argparse
import grp
import json
import os
import pika
import pwd
import rabbit_config as rcfg
import sys
import uuid
from rc_rmq import RCRMQ
from rc_util import timeout
from rc_util import get_caller_info, timeout
# Instantiate rabbitmq object
......@@ -40,6 +39,9 @@ def manage_group(op, usernames, groupname, debug=False):
status = dict.fromkeys(usernames, False)
response = 0
interface = "CLI"
executed_by, host = get_caller_info()
def handler(ch, method, properties, body):
if debug:
print("Message received:")
......@@ -75,6 +77,9 @@ def manage_group(op, usernames, groupname, debug=False):
"msg": {
"groups": {f"{op}": [f"{groupname}"]},
"username": user,
"host": host,
"executed_by": executed_by,
"interface": interface,
},
}
)
......@@ -109,8 +114,6 @@ if __name__ == "__main__":
)
args = parser.parse_args()
executed_by = os.getenv("USER")
exist_users = []
miss = False
......
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