Skip to content
Snippets Groups Projects

Fix acct create agent

1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
+ 3
3
@@ -27,7 +27,7 @@ def create_account(msg):
@@ -27,7 +27,7 @@ def create_account(msg):
uid = msg['uid']
uid = msg['uid']
email = msg['email']
email = msg['email']
fullname = msg['fullname']
fullname = msg['fullname']
success = False
msg['success'] = False
try:
try:
# Bright command to create user
# Bright command to create user
@@ -49,11 +49,11 @@ def resolve_uid_gid(ch, method, properties, body):
@@ -49,11 +49,11 @@ def resolve_uid_gid(ch, method, properties, body):
msg = json.loads(body)
msg = json.loads(body)
logger.info("Received {}".format(msg))
logger.info("Received {}".format(msg))
username = msg['username']
username = msg['username']
success = False
msg['success'] = False
# Determine next available UID
# Determine next available UID
try:
try:
user_exists_cmd = "/usr/bin/getent passwd {username}"
user_exists_cmd = f"/usr/bin/getent passwd {username}"
user_exists = popen(user_exists_cmd).read().rstrip()
user_exists = popen(user_exists_cmd).read().rstrip()
if user_exists:
if user_exists:
Loading