Commit bb9fd91a authored by Benjamin Baer's avatar Benjamin Baer
Browse files

usernames changed to list, better error output, no function for agent logoutuser to test lists

parent d30be6a9
......@@ -43,15 +43,15 @@ class LogoutUser(managementagent.RabbitModule):
else:
process = subprocess.Popen(['/usr/bin/pkill', '-u', username])
#process.wait()
#if process.returncode != 0:
# logger.warning("Failed to logout user %s", username)
# self.send_reply(reply_to, process.returncode, "Error executing pkill command (%i)" % (process.returncode,))
#else:
# logger.info("User %s logout succesfull", username)
# self.send_reply(reply_to, 0, "Ended sessions for %s" % (username,))
self.send_reply(reply_to, 0, "Ended sessions for %s" % (username,))
process.wait()
if process.returncode != 0:
logger.warning("Failed to logout user %s", username)
self.send_reply(reply_to, process.returncode, "Error executing pkill command (%i) for user %s" % (process.returncode, username))
else:
logger.info("User %s logout succesfull", username)
self.send_reply(reply_to, 0, "Ended sessions for %s" % (username,))
except Exception as ex:
self.send_reply(reply_to, -1, repr(ex))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment