fix: Minor fixes

This commit is contained in:
cr0hn
2016-03-04 23:33:25 +01:00
parent c7134e109f
commit ddc6a3c34f
2 changed files with 15 additions and 5 deletions

View File

@@ -22,9 +22,13 @@ def action_redis_server_disconnect(config):
# Disconnect all clients?
if config.disconnect_all:
for c in clients:
con.client_kill(c)
try:
con.client_kill(c)
log.error(" - Client '%s' was disconnected" % c)
except redis.exceptions.ResponseError:
log.error(" - Client '%s' is not connected" % c)
log.error(" - Client '%s' was disconnected" % c)
# Disconnect only one user
else:
@@ -35,9 +39,12 @@ def action_redis_server_disconnect(config):
try:
_c = clients[config.client]
try:
con.client_kill(_c)
con.client_kill(_c)
log.error(" - Client '%s' was disconnected" % _c)
except redis.exceptions.ResponseError:
log.error(" - Client '%s' is not connected" % _c)
log.error(" - Client '%s' was disconnected" % _c)
except KeyError:
log.error(" <!> Client '%s' doesn't appear to be connected to server" % config.client)

View File

@@ -65,7 +65,10 @@ def action_proc_list_tasks(config):
# Save template
# --------------------------------------------------------------------------
# Build path in current dir
export_path = "%s.json" % os.path.abspath(config.template)
export_path = os.path.abspath(config.template)
if ".json" not in export_path:
export_path += ".json"
# dumps
json.dump(export_data, open(export_path, "w"))