Skip to content
Snippets Groups Projects
Commit 10d57579 authored by Cloud User's avatar Cloud User
Browse files

Added a print message for every agent

parent 516dfdb7
No related branches found
No related tags found
3 merge requests!23Feat resolve uid gid,!3Adding following agents,!4Test infra 1
......@@ -40,6 +40,7 @@ def slurm_account_create(ch, method, properties, body):
username = msg['username']
try:
subprocess.call(["sudo", "useradd", "-m", username])
print("User {} has been added to {}".format(username, hostname))
except:
print("Failed to create user")
......
......@@ -42,6 +42,7 @@ def slurm_account_create(ch, method, properties, body):
try:
subprocess.call(["sudo", "groupadd", "-r", "-g", user_gid, username])
subprocess.call(["sudo", "useradd", "-u", user_uid, "-g", user_gid, "-m", username])
print("User {} has been added to {}".format(username, hostname))
except:
print("Failed to create user")
......
......@@ -39,6 +39,7 @@ def slurm_account_create(ch, method, properties, body):
username = msg['username']
try:
subprocess.call(["sudo", "sacctmgr", "add", "account", username, "-i", "Descripition: Add user"])
print("SLURM account for user {} has been added".format(username))
except:
print("Failed to create 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