fix: Minor fixes
This commit is contained in:
@@ -22,9 +22,13 @@ def action_redis_server_disconnect(config):
|
|||||||
# Disconnect all clients?
|
# Disconnect all clients?
|
||||||
if config.disconnect_all:
|
if config.disconnect_all:
|
||||||
for c in clients:
|
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
|
# Disconnect only one user
|
||||||
else:
|
else:
|
||||||
@@ -35,9 +39,12 @@ def action_redis_server_disconnect(config):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
_c = clients[config.client]
|
_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:
|
except KeyError:
|
||||||
log.error(" <!> Client '%s' doesn't appear to be connected to server" % config.client)
|
log.error(" <!> Client '%s' doesn't appear to be connected to server" % config.client)
|
||||||
|
|||||||
@@ -65,7 +65,10 @@ def action_proc_list_tasks(config):
|
|||||||
# Save template
|
# Save template
|
||||||
# --------------------------------------------------------------------------
|
# --------------------------------------------------------------------------
|
||||||
# Build path in current dir
|
# 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
|
# dumps
|
||||||
json.dump(export_data, open(export_path, "w"))
|
json.dump(export_data, open(export_path, "w"))
|
||||||
|
|||||||
Reference in New Issue
Block a user