Commit d30be6a9 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 a06c233c
......@@ -39,18 +39,19 @@ class LogoutUser(managementagent.RabbitModule):
force = False
if force == True:
logger.warning("process = subprocess.Popen(['/usr/bin/pkill', '-u', username, '-KILL'])")
process = subprocess.Popen(['/usr/bin/pkill', '-u', username, '-KILL'])
else:
logger.warning("process = subprocess.Popen(['/usr/bin/pkill', '-u', username])")
process = subprocess.Popen(['/usr/bin/pkill', '-u', username])
process.wait()
#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,))
#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,))
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